Looking for cause of lots of tcp connections to sql server port 1433 in time_wait state

Disclaimer: never used this ATL/OLE DB, nor C++ in a while but a stab in the dark here. Could the issue be this ATL/OLE DB connection technology doing its own thing under the hood to keep connections alive?

Have you looked into using connection technologies other than ATL/OLE DB and see what happens? such as GitHub - microsoft/VCSamples: Samples for VC++