On the Energy Transfer between the Electromagnetic Field and Nanomachines for Biological Applications