When adding a shared DLL you should encapsulate the DLL in a component with the same ID in both products. The component will be installed when it is not already installed. It will be removed when the last product that uses it is uninstalled. Use a WiX library to handle the shared component.
You will have to find a install location for that shared DLL. When you uninstall product A you will expect that the install folder of the product is removed and the same appears for product B. Therefore the shared DLL should be in the Common Files tree.
Since the COM registration has always an absolute path to the COM server DLL, it is always bound to the DLL in the appropriate product. If the product installers don't share the knowledge about the shared DLL your product should avoid sharing the DLL. You can use Registration Free COM to achieve this.