Modifying a keyboard/mouse/game controller is a possibility for many projects of this type.
Or you could use something like an Arduino as an analog/digital input adapter. This would connect to the PC via USB, and generally would like like a serial port to your program. Your program would just monitor the serial port for data, which could be single bytes indicating various events, several byte messages, or even human-readable newline-terminated strings. The later can make debugging a lot simpler if you don't need to move so much data that you would fill up a high speed serial pipe. For example, your data might look something like this:
airbrake 0\n
throttle 10\n
throttle 85\n
whistle 1\n
whistle 0\n
Or for firmware simplicity, it might be something like
digital 3 0\n
analog 2 10\n
analog 2 85\n
digital 4 1\n
digital 4 0\n
Leaving your PC program to map the channels to names based on knowledge of the wiring of your adapter to the physical controls