There are many libraries out there, usually the particular OpenSocial provider (like MySpace) will have their own flavor. Here is a link to Myspace's, though I have not used it personally as we rolled out won custom library long ago.
The first thing to note is that no two OpenSocial providers are the same. Myspace is is different from Hi5, Friendster, Ning, etc. They all have little caveats to work around. Get used to this.
Now, the first problem you have to work around is that OpenSocial is client-side code that runs on a different domain from your server. This means that all the xhtml, javascript, etc must conform to the OpenSocial canvas. For IE6, this means operating in QuirksMode. Sucks, right? What we ended up deciding to do was to have OpenSocial load our site in an Iframe.
I wrote an introductory slide deck on this subject some time ago. The basic idea still applies today, though it may be a little out of date. You can download the slide deck here.