Original way requires AMS SDK and a VisualStudio (not the express versions since its dont include MFC that is somewhat needed)
I've posted a object plugin template without MFC but would require better understanding of winapi on your side.
I've also posted notes on doing objects on c# by using the activex object long time ago, but i encourage to use other ways now.
For example if you're using luajit replacement, you can always do your own objects on lua side, take a look at this lib
https://luapower.com/winapi