A iMac used as a display is referred to as target display mode. It can only be connected to another thunderbolt mac via a thunderbolt cable. So that's two reasons why you can't do what you want (connecting to a pc, and trying to using vga).
Only if the PC is 100% compatible, the PC has to have Thunderbolt output and have the ability to send a video signal through the Thunderbolt output port. To be honest I haven't seen a PC that does that yet, but who know they may be coming.