Instructions
Setting Up the PS3 Controller
Connect your PS3 controller to your computer using the USB cable packaged with the controller (the same cable you use to connect to the PS3).
Open the preferred emulator and access the "Preferences" menu. Open the sub-menu, "Configure Controller," "Joystick" or similar. Select the PS3 controller from the list of options. If the PS3 controller is not an option, skip to Section 2 -- Installing a Driver.
Push the PS button in the center of the controller when the emulator asks you to map the gamepad keys. Then, configure the PS3 controller for your emulator by selecting which keys do what. For instance, if you're playing Nintendo 64 games, you could map the yellow buttons to the right axis, the joystick to the left axis, the red and blue to X and O, and so on. Some emulators will already have this configured.
Installing a Driver
Use a search engine to find a "PS3 Sixaxis driver" for your operating system. PC and MAC drivers exist and there are many options, but scan through the first few links and you will find a fit.
Download and install the selected driver onto your computer. Once complete, connect your PS3 controller to your computer using the USB cable packaged with the controller (the same cable you use to connect to the PS3).
Perform the steps listed above in Section 1 -- Setting Up the Controller.