Emulation
To play Nintendo games properly on your PC, software must be programmed so that the PC will accept the code present in Nintendo games. This is not something that you have to do yourself. Many websites are run by people who create such nostalgia-enabling software as a hobby.
Emulators
You can download emulator software along with the games that you wish to play or you can visit websites that emulate the software from their end.
Downloading
Find a site that is operating within copyright law if you wish to download the software. In some cases, the games that are compatible with these emulators may be hacked versions. For example, the referee in Mike Tyson's Punch-Out! may be Nintendo's pink, puffy character Kirby instead of an actual ref.
vNES
VirtualNES.com has an extensive library of games, all of which are uploaded from personal collections of the people who run the website and additional game purchases they've made to increase the size of their game library. Nintendo8.com is a similar website.
Controls
Emulation websites and download-able emulators can be compatible with peripheral controllers.
Compatibility
As with any peripheral accessory for PC, controllers need to be configured. Whether a peripheral controller is compatible with a game depends on the game and the code used.