Well, you haven't told us much about which gamepad or whatever, I wouldn't think it would matter anyway, so I'll just tell you how I do mine and hope it helps...
You just get PCSX2 running, go into the plugins configuration from the pulldown menu, and choose your controller plugin (if one doesn't show up in the pulldown list you need to get a plugin), probably Lillypad, that's the one I used. Then hit the button to configure the keys for it (it has a nice diagram of a PS2 gamepad). Click on the button you want to assign, then press that button on the controller. It should register and assign that button. Repeat for all the buttons.
Whoops! Forgot I was browsing the ePSXe section and not PCSX2. Sorry about that, but the response is still about the same.
Get ePSXe running, and it will ask for you to configure it, if not just go to the "Config" pulldown menu, go to Gamepad > Port 1 > Pad 1 and you should get a nice diagram of a controller where you bind your gamepad's buttons to whichever Playstation gamepad functions you like. If it won't recognize the input from your gamepad in that dialog, I don't know what to tell you...need more info.
Here's a screenshot of mine partly configured to my Playstaion Dual Analog Controller with the USB adapter.