I'm pretty sure there's tons of info on this. First stop should be at paypal.com and look into IPN. I'm pretty sure you'll need a PayPal account to do this (you have to log in, and then go find the developers section, or look for merchant info, or search for IPN docs).
You can also look at hotscripts.com and do a search for PayPal IPN and I'm sure they'd have some scripts up there to play with.
In my opinion, the FIRST thing you should do is sit down and spend some time (like an hour or two) and just read over the IPN process and how it works. Sure, you can grab code off of hotscirpts, but if you have no understanding of why it works, it'll be tough to integrate the code into your site and troubleshoot it.