USB ports not working, no paired magic keyboard, "no bootable device, press any key" on an iMac 2009
Since you've ruled the HDD out, the remaining options are pretty much the hard drive cable or the logic board. As none of the USB ports work, it sounds like a logic board issue. A way to test would be to reset the PRAM. To do this, plug in a USB keyboard, then before powering on the machine, hold then Cmd, Option, P, R keys all at the same time,hen reach back and power on the machine while holding the keys. Continue to hold the keys.

If the logic board is working, the machine will power on, you may see a white screen, then it should reboot and chime again. Keep holding to see if you can get it to chime multiple times before releasing the keys. 

If that works, then the USB ports are working, and you'd be looking at an issue with the HD cable. Otherwise, unfortunately, it's most likely the logic board, but again, that would require a trip to an Apple Store or AASP (Apple Authorized Service Provider).