To access the data you open the key and then query the value -
I think you could probably do something similar to write to data to a key using RegSetValueEx(). However you'll need to adjust the access when opening the key, and ensure the person using your program has admin rights on NT based Windows.
TCHAR sk = "Software\\Microsoft\\Windows\\CurrentVersion";
From your example I'd guess it'd be something like this -
Assuming you'd already opened the HKEY_LOCAL_MACHINE\Software\MySoftware with the required access using RegOpenKeyEx(). This is untested so you may have to changed it around to get the required result.
TCHAR data="Bill Gates";