The first way to auto destroy objects is to expose an Interface and free your object in the Release method. You can inherit from several class types that already do that if you don't want to rewrite a new class.
The second way is a newer feature that allows you to define Initiazlize and Finalize methods on any complex type. When you define these methods, the compiler generates code to reference count your object and call Initazlize on create, and Finalize when your object is no longer referenced. This works the same on stack based types as well as heap allocated types.