At a very old job (circa Visual Studio 6!) I spent a few years using COM and the ATL to add scripting support to an application. This is some of my old info on doing so.

COM Code Snippets