I have no actual example, but this post is exactly your question. Also check out the rest of his blog, there are more posts about 4.0 profilers (and profilers in general).
By the way, in the comments section of the linked blog, he says that the official source of profiler 4.0 is not ready, but when will he post about it. (Although it was 4 months ago or something like that.)
Edit: CLRProfiler 4.0 has just been released and contains the source code, so you got your sample; -)
Zarat source
share