To get 3D Hardware Acceleration without using a traditional API, you essentially need to write your own code to duplicate the functionality of the graphics driver. So the best way to learn how to do this is to look at the code of the graphics driver.
For NVIDIA cards, you should look at the open source nouveau project. They have a collection of great resources here.
For other brands of graphics cards, you can find similar projects and documentation.
Note that as has been mentioned in other answers, most modern operating systems will prevent user-space programs from directly accessing hardware, so you will need to write your code and install it as an operating system driver. Alternatively, you can use the FreeDOS operating system, which has no such restrictions, and should let you (in theory) directly access the hardware, and allow you to write a regular program that renders 3D hardware accelerated graphics. Note that, even leveraging code from an existing open source graphics driver, this would be a tremendous amount of non-trivial work (and as far as I'm aware, has never been done, and due to various reasons, might actually not be technically possible).