I just came out from a harrowing week facing a similar issue. So I'll try to summarise everything till it is still fresh in my head.
There are multiple approaches to the problem depending upon your target IE version -
IE 10 and upwards
There is no real issue here. All you need to do while creating the Installation Package (Setup.exe) is build it in Release Mode with the platform as AnyCPU[1]. This will run the ActiveX irrespective of the underlying machine's architecture.
IE9 32-bit
Publish the dll and the ActiveX as you normally would on a 32-bit machine and deploy.
IE9 64-bit
This is where things get a little hairy!
There is no way to make the said dll and ActiveX restrictions work on an 64-bit IE9. So much so, that even Adobe Flashplayer won't run due to the imposed security restrictions. Read more about it here.
Posting some relevant excerpts:
For the past several releases, Internet Explorer has sported a multi-process architecture, where the “Frame” or “Manager” process runs at Medium Integrity and the “Tab” or “Content” processes run at either Low Integrity (Protected Mode) or Medium Integrity (for Zones where Protected Mode is disabled, like Intranet sites). All HTML content and ActiveX controls run in the Content Process.
In Internet Explorer on the Desktop, by default, Content Processes remain at 32bit by default for compatibility with 32bit ActiveX controls, Toolbars, BHOs, etc. Even when you directly launch the 64bit iexplore.exe executable, you will still have a 64bit Manager Process that hosts only 32bit Content Processes.
All said and done, there still is a work around.
- Deploy your 32-bit ActiveX (I know it's a 64-bit machine, hold on).
- Search for "Internet Explorer" under the Start menu.
- You'll see 3 versions of IE. Launch the IE which has nothing written next to it in parentheses. The other 2 would be IE (64-bit) and IE (no add-ons).
- Create a shortcut of this IE on your desktop.
This IE is the 32-bit version of the application which comes pre-packaged in your OS. Run your HTML and it should work like a charm!