While I don't want to imply that the other answers are not right on their own, they provide far too many details that, I'm afraid, are still very obscure to you.
The basic answer is that the code will be executed directly on the processor. And no, the machine code will not "talk" to anybody, it's the other way around. The processor is the active component and everything you do in your computer will be done by that processor (I'm simplifying things a bit here but that's OK for now). The processor will read the code and execute it and spit out the results, the machine code is just food for the processor.
Your confusion stems from the use of the word hardware. Although the division isn't as clear cut as it used to be, it's better if you think in terms of peripherals rather than simply calling everything hardware. So, if there is an operating system or similar on your machine, your program has to use its services for accessing the peripherals but the processor itself is not a peripheral, it's the main processing unit that your program runs on directly.
Kernels, operating systems and similar intervening layers are typically used only in larger systems where there is an expectation that several programs will run and there is a need for the system to manage how these programs can use the peripherals of the computer (quite often at the same time). In these cases, running programs can only access these peripherals using the system that will decide how to share them and will make sure there are no conflicts. Small systems where there is no need for any management among competing programs because there are none, often have no underlying system at all and the single program normally running on these systems is more or less free to do whatever it wants with the peripherals.