We have example C/C++/Objective-C code in the TurboActivate packages. It's in the "API\C" folder.
To deactivate just call (the passed parameter means keep the product key on the machine to make it a 1-step re-activation):
HRESULT hr = Deactivate(0);
To reactivate, just call:
HRESULT hr = Activate();