MatthewH wrote this instructables describing how to use an Arduino Leonardo (or similar) card to make your classic console joystick look like a USB keyboard:
If you grew up in the early 1980’s and were into video games, you probably had an Atari 2600, ColecoVision, or similar game console. The controllers or joysticks for each of these systems had a distinct feel that is different from today’s game consoles or PC game controllers. If you find yourself longing to plug your old ColecoVision or Atari 2600 joystick into your modern PC, but are not sure how to go about it, this project is for you.
I designed this Classic Joystick to USB Keyboard Adapter with the ADAMEm ColecoVision and Coleco ADAM emulator in mind (which can be run in Microsoft Windows using Virtual ADAM).
You can also find Matthew’s post on his blog – mheironimus.