Registration in HKCR (and related mapped hives) requires admin privilege and always did. This is essentially the same problem as "I could write to the Program Files directory in XP but not in Vista". That's because everyone was an administrator on XP but since UAC nobody is an administrator unless they elevate somehow (run as administrator being a common one, the other being a UAC elevation prompt).
Common reasons for self-registration to fail at install time are:
Lack of elevation (such as a per user install that never shows a UAC elevation dialog).
Missing dependencies. There may be a Dll that yours depends on, and it's not on the target system. If registration works AFTER the install is complete you may have a dependency on a Win32 or managed code assembly. If you have a dependency on a C++ runtime that goes to WinSxS and you included it as a merge module then it won't be committed until after the install has finished and your registration will fail. The same is true of assemblies going into the GAC but that seems unlikely in your Win32 registration case. If it's random on Windows 7 that's typically because some systems already have (say) the C++ runtimes installed and some don't.
Most tools these days, including Visual Studio and WiX, can do extraction of COM registration at build time. It's static data so there's no reason it can't be in the MSI file. In the WiX case the tool is called Heat. It also means there is no need to call the Dll at install time, avoiding dependency issues. The vsdraCOM setting does this and I've used it successfully, but like every registration it requires dependent Dlls to be available at build time. There's no good way to see if it's worked, but if you get an MSI editor (such as Orca from the Windows SDK) and open the MSI file with it you should see your classes in the Class table, and there'll be something in the Registry table.
It might also help if you had more detail about what "will not register" actually is. Are there missing Interface entries, CLSID entries, error messages at install time, apps that fail to run because they can't instantiate a class?