I don't mean through a Tor instance. I know how to connect to Tor when it is open. There are plenty of guides on it.
Tor is open source, which admittedly I haven't looked in depth at. What I want to do is spawn a Tor instance inside of C++ or a similar language, without the use of the Tor Browser. Is there anyway this can be done? I am not an expert on the Tor network, but I am fairly good at programming various languages. Wouldn't I just have to grab the list of Tor Nodes, select which ones to connect to, and form the packets correctly? I am probably vastly underestimating the process, because I don't really understand how .onion websites fit into this process.