First of all, you'd have to unmask all the programs required to make KDE4 happen. Check the /usr/portage/profiles/package.mask for the full list of masked KDE4 apps. Create the file /etc/portage/package.unmask, and add all the listed masked programs (including dependencies, such as poppler-8.0) to the file. A simple cut and paste should do the job nicely.
Then you'd want to remove KDE3.5. Use the Wiki
HOWTO. I recommend doing this before you install KDE4.0 to prevent any possible weirdness getting to KDE4.0.
Finally, you will want to issue the command (assuming you want everything AND the KDE kitchen sink, which isn't a bad idea, actually) emerge -av kde-base/kde-meta:kde-4. At this time, KDE4.0 is only offered as a meta-package. That makes getting rid of it a real pain in the tushy. It is doable, though, just in case you change your mind.
That should get you going, but I need to tell you that I haven't worked with KDE4.0 without using kdm as a front-door to it. As far as I know, you should be able to keep your ~/.xinitrc in tact, as KDE4.0 reputedly opens with "exec startkde", the same way it does for KDE3.5. However, I cannot independently verify that at this time.
Good luck.
Blessed be!
Pappy
This space left intentionally blank, except for these ASCII symbols.