The wiki here is a fantastic resource. But let's see what I can do about your questions.

First thing, about the emulator. I assume you downloaded MAME and installed it. When you put the ROM files into the directory, are you getting any error msgs? Most folks run into a particular issue right off the bat. There are several versions of most games, and the fact that you mention Pac-Man makes me think you ran afoul of this. The original (parent) was actually called PucMan. The American version is a clone. So if you DL'd a Pac-Man ROM, it only contained the files that were different than the original. So for example...
PucMan contains:
File 1
File 2
File 3
the PacMan ROM you DL'd had:
File 2a (a modified version)
File 4 ( a new file)
So in order to work you would need either a merged ROM that has all the files or you'd need to have the parent ROM in the directory along with the clone (PacMan) ROM.
Once you get things working on the PC end, you need an encoder. There are a whole bunch of them available. Back in the day you would gut a keyboard and hack the controller for you joysticks and buttons. Nowdays things are MUCH easier. You have many off the shelf choices. Devices that you simply wire your controls to them, often using screw terminals, and plug the device into your comp. The PC then sees the device as either a keyboard device or a gamepad depending on the device.
Some choices:
Groovy Game Gear sells the KeyWiz and the GP-Wiz
Ultimarc sells the I-Pac2
Paradise Arcade has one but I can't recall the name.
There is also the Howler and the Ultimarc Ultimate if you wanted an all in one soution for controls and LEDs. Zero Delay and Xin-Mo if you want cheap Chinese.