"Undo objects" in the API

Has anyone developed an addin which creates something new inthe SW part and adds it to the UNDO queue so that it's undo-able bythe user?
There's some documentation about Undo Objects, but I'm not quitesure I understand how it works.
I'm using SW2009 and my addin is developed in C++, but any examplesin that language would be best, but I won't be choosy.SolidworksApi macros