There is no general simple way to scan for all different hardware on a computer. Probably that is the reason you were not successful when searching for it.
You could start scanning trough PCI devices, then scan for USB devices, etc. However, each of these steps will not be trivial. The osdev wiki will provide some pointers. You could start with scanning pci devices (code examples are in C), and you could look at the source of an operating system written entirely in assembly, like kolobrios, if writing your OS in a C/assembly combination is not an option for you.