UPDATE: although this post was originally written in regards to running Windows in VMWare Fusion, as pointed out by multiple kind people who have commented on this post, this information is also useful for those accessing Windows through means other than VMWare Fusion including Parallels and Remote Desktop. Accordingly, I have changed the title of the post to include Parallels and Remote Desktop.
I use a MacBook Pro and on it I run VMWare Fusion on top of which I run Windows XP. Normally, when Caps Lock is on in the Mac, it's on in the Windows XP instance and when Caps Lock is off in the Mac, it's off in the Windows XP instance. However, from time to time, on the Windows XP instance Caps Lock becomes "inverted"--that is, Caps Lock on the Windows XP instance is reversed from what it is on the Mac. So on the Mac, Caps Lock will be off and on the Windows XP instance, Caps Lock will be on. Or, the Mac Caps Lock will be on--and so will be the light on the Caps Lock key--yet the Windows XP instance Caps Lock will be off.
Okay, now that I've established the problem, I'll go ahead and explain the solution, then for those interested, I'll backtrack into the details.
UPDATE: there is, at least in VMWare Fusion 2.0, a simpler solution than I originally detailed in this blog post (that original solution and my explanation of the cause of the problem are still included below): go to the Virtual Machine menu in VMWare Fusion and choose Send Key ==> Caps Lock. You'll note while you're there that there are a number of other keys you can send as well; I discovered this whole capability tonight while looking around to try to find a way to send the Insert key (Insert had gotten toggled on in Internet Explorer and I wanted to toggle it back off) which I didn't know how to do directly because the MacBook Pro keyboard has no Insert key.
UPDATE: as pointed out by Bob in one of the Comments to this entry, another simple solution is to launch the On-screen Keyboard application (generally this can be done by choosing Start ==> All Programs ==> Accessories ==> Accessibility ==> On-screen Keyboard; as noted by DrFooMod2 in a comment below, you can also bring up the On-screen Keyboard by typing "osk" without the quotes in the Windows Run... box) and toggle Caps Lock by clicking on the virtual "lock" button in the application. The On-screen Keyboard application shows--and can change--the state of Caps Lock in the Windows XP instance without any regard to the state of Caps Lock on the Mac itself.
So here is the solution: in the Windows XP instance, open an application that can toggle Caps Lock (didn't know Windows apps could do such a thing? Surprise!) such as Microsoft Word and go into whatever context is required for the app to toggle Caps Lock (in Word, that means typing in a document). Make sure Caps Lock on the Mac is off; this will mean that Caps Lock in the Windows XP instance is on. Start typing normally (that is, as if Caps Lock in the Windows XP instance is off); if you try to type "Hello" what you'll get instead is "hELLO" but as soon as you hit the space bar, the app will "correct" what you typed to "Hello" and toggle the Windows XP instance Caps Lock off--and as a result, Caps Lock will be back in synch between the Mac and the Windows XP instance. :)
Why does this problem happen in the first place? You've probably figured at least part of that out already: when you use an app that can toggle the Windows XP Caps Lock and you have Caps Lock on but type in a way that the app thinks indicates Caps Lock is on unintentionally, it "helps" you by "correcting" what you typed and turning off Caps Lock on the Windows XP instance for you. This isn't necessarily a bad thing--in a standalone Windows XP instance. However, with consideration to the fact that in this case it causes the Windows XP instance to toggle its Caps Lock but doesn't do the same for the Mac such that the Windows XP Caps Lock and the Mac Caps Lock become out of synch, it's not good. And why doesn't the toggling of Caps Lock in the Mac instance cascade up to the Mac anyway? As well as I can tell, Mac applications do not have the ability to toggle Caps Lock on and off (side note: this makes complete sense when you note the difference between what Windows & Mac do when you press the shift key while Caps Lock is on: on Windows, it's sort of a "double negative" type of thing such that the result is a lowercase letter whereas on Mac, the result is still an uppercase letter--so then it wouldn't make sense for the app to toggle Caps Lock) which means that VMWare Fusion can't toggle Caps Lock on the Mac when it is toggled in the Windows instance (now, I'm not even sure that VMWare Fusion can detect Caps Lock being toggled in the Windows instance but if VWWare Fusion can't toggle it on the Mac then really it's a moot point whether or not it can detect it being toggled in the Windows instance).
One note of interest: the behavior here makes it clear that the Mac-VMWare Fusion-Windows XP instance communication isn't along the lines of "Caps Lock on" or "Caps Lock off" but rather "toggle Caps Lock." See, you'll note that I didn't indicate that to fix the problem you just have to hit the Caps Lock key on the Mac and it will get things back in synch--that would work if the communication were "Caps Lock on" or "Caps Lock off" but since it's just "toggle Caps Lock" all that happens is that the Caps Lock gets reversed the other way around!
UPDATE 2012-07-27: this blog post is 2 days shy of being 4 years old and it's still generating comments! One such comment below states "Here is a simple solution (work around) that worked for me for inverted caps lock (same for num lock). When you are on VM or NXClient press 'alt'+'ctl'+'del', then press the caps lock(same for num lock). Then press 'escape'. Hope this works." I haven't tried this but wanted to pull it up here in the blog post in case it's of help to you. Thanks for the tip, Partha.