Where can I get the code that creates the progress bar for Personal Campaign Pages?
I'm not sure there's an 'easy' way to do it (similar to the widget code for an entire Contribution page). In the past I've done something like it by writing a custom plugin (for Wordpress) that used mysql queries to pull data from active PCPs. I don’t believe there’s a fully operational API for PCPs yet - that would probably let you avoid writing queries yourself - there is however an unofficial API that you might find useful.

Incoporating PCPs in Wordpress