I would start by reading the pages for various database drivers, they do have different levels of examples and information so you might get more clues from comparing them.
I just had a look at ODBC, and PostgreSQL but there are others like Oracle and more.
You'll want to start with a ogrinfo on the database itself, start with the minimum of the server and database name using the examples in the page above, something like this, but it depends on exactly how you refer to your specific database, and whether you need user/pass etc. Obviously we don't know what version of SQLSERVER you have so the string below won't be correct, for either the server or the database component:
The "driver:datasourcename[layer]" pattern is common across GDAL vector sources when you aren't pointing to an actual file, or folder.
Once you've got that working you have a confidence that doing the same from C++ can work with a known source string and layer name and options, and you'll be delving into the API documentation and examples.
Other than that you'll need to provide details about what you've tried, and what you see. (It's easy to set up an ODBC data source on Windows for other drivers so that might be a way to make sure you are doing everything right in a simpler scenario. )