It took me two hours, but I fixed this last night.
First off, you need to go into Mac OS and remove the keyboard and mouse from your Bluetooth settings entirely. You'll add it back in later.
Boot into Windows.
Click on the Bluetooth control panel, and go to settings. Under Hardware, it probably says 'Generic Bluetooth Adapter'.
Click 'Properties' and 'Change Settings'.
Go to drivers, and 'Update Drivers'. Have Windows look on your machine to find all available drivers ('Let me pick from a list')
UNselect 'Show Compatible Drivers'.
Look for 'Apple' in the manufacturer names, then select the Apple Bluetooth Driver. Install.
Once this is done, pair your keyboard through the wizard. It should now bring up a passcode and confirm it much more quickly than before.
Once this is done, go back to Bluetooth settings and return the Drivers to 'Windows Generic'. If you leave it on the Apple drivers the keyboard will disconnect randomly and frequently.
Your keyboard will now be paired, but won't work. Go to the Device Manager, right click on the entry for the wireless keyboard.
Click on 'services'.
It should bring up a single entry for keyboard/mouse HID services. Click this and press Apply or OK. After it installs, you should be golden.
There are two issues here - one is that Mac OS seems to 'reserve' the Bluetooth device such that it won't pair correctly with any iteration of Windows while it's already paired in OSX. It works fine the other way around, however, so you need to make sure it's set up in Windows before Mac OS. Second, there's a Bluetooth driver issue in Windows 7 such that it won't pair with the keyboard - it'll run through the steps, but the keyboard itself will not appear to actually 'get it'. Switching to the Apple drivers briefly will ameliorate this and allow proper pairing, but to actually keep the keyboard working you should use the built-in drivers.