You can use the ServiceInstaller.Uninstall method in System.ServiceProcess.dll. For example:
ServiceInstaller ServiceInstallerObj = new ServiceInstaller();
InstallContext Context = new InstallContext("<>", null);
ServiceInstallerObj.Context = Context;
ServiceInstallerObj.ServiceName = "MyService";
ServiceInstallerObj.Uninstall(null);
This method will attempt to stop the service first before uninstalling.