CLRProfiler V4 is now publicly available. You may download from here:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=be2d842b-fdce-4600-8d32-a3cf74fda5e1
This is of interest both to folks who want a free profiler to diagnose memory issues with their managed apps, and for folks who author profilers of their own, and would like to look at source code of a real-world example of a profiler.
Then the following new features will be of interest to you:
Then you may look through the source code for examples of all the above features, including how to target Silverlight, use the attach / detach API, and how to implement the “pick-one” approach for in-process side-by-side CLR instances.
Also, CLRProfiler V4 consumes the new Enter3/Leave3/Tailcall3 signatures along with FunctionIDMapper2, so you can consult the source for examples of the naked assembly language wrappers.
If you encounter problems with CLRProfiler V4, the best place to go is our forum:
http://social.msdn.microsoft.com/forums/en-US/netfxtoolsdev/threads/