You can compact a VHD in Windows 7 using diskpart.exe’s COMPACT option.
Also, if you don’t mind a little coding, you can call the CompactVirtualDisk API (I’d post a link to it, but new users can’t post hyperlinks – just search MSDN for it if you’re interested).