Fix compiler bugs and add project using COM object.

Make C++ object to COM object using standard COM APIs.