You have to implement the IObjectSafety interface.
I cut this code from a MSDN example and it worked great for me without any
changes. This code basically makes everything your control does safe for
scripting and initialization.
You can make the following changes in your class declaration:
class ATL_NO_VTABLE TYourcontrol:
.
.
, public IObjectSafetyImpl<TYourcontrol> // <--- Add this.