I am working on windows services for the first time and after some effort I am now able to Install and unistall a service programatically in C++, I have found many tutorials
At least based on the code you've linked, you have a ServiceMain, and (presumably in main) you call CreateService.
main
CreateService
The step you seem to be missing is a call to StartService after you call CreateService.