Essentially what happens is - some of the address space (not the RAM itself, but the addresses of the RAM) is used for other purposes. So neither operating system can talk to that part of the RAM - so it's not used for anything at all.
How much depends on the exact system configuration and chipset.
If integrated graphics are fitted - then some more of the RAM is allocated (and actually used in this case) for graphics.
I have to point out that memory is not only dependant on the operating system, 4 gig is the limit true enough for a 32 bit OS but if you have a older PC you might find that the motherboard can only support 2 gig of memory so its sensible to check the motherboard manufacturers website just in case. If its a new PC I don't think this would be the case only some older PCs but do check.
To answer your question 64 bit XP or Vista can see upto 8 gig I believe and maybe windows server but I'm unsure about that, but there is some issues with 64 bit windows in that it needs 64 bit drivers for everything and the drivers must be Microsoft certified, if the drivers are not Microsoft certified then windows will not allow them to be loaded. I am unsure if theres other problems as well such as running programs etc and the type of processor supported etc.