Welcome to Apple Support Communities
The Late 2012 iMac has only got a Thunderbolt port, and it can only be used as an external display for other Macs with Thunderbolt > http://support.apple.com/kb/PH11302
That means that you shouldn't be able to use your iMac as an external display for another PC, more when the PC has got a HDMI port. If you want, you can try buying a Mini DisplayPort to HDMI adapter and a HDMI cable (or a Mini DisplayPort to HDMI cable) and see if you can put your iMac in Target Display, but do it at your own risk because it's probable that it won't work
Using the mini-DisplayPort to HDMI adapter in reverse will not work. Using an HDMI signal as input to a Thunderbolt port would require circuitry to change the signal, and while there are such adapters for Macs with mini-DisplayPort inputs, I've yet to see one that works with iMacs with Thunderbolt ports.