How does Apple calculate the energy consumption of a process in OS X Mavericks
There are many aspects of CPU utilization that affect energy consumption. It's not merely how much CPU does an application consume, but also how often and how flexible it is about it. The latter can have much bigger effect.

An application that needs to wake up exactly every 10ms to execute just a few lines of simple Obj-C code can have an order of magnitude larger energy impact than the same application executing thousands of lines of code but just once a second and not being very particular about exactly when within that second will the calculation happen.

Apple probably uses Intel's performance counters and accounts them to your application. You'd probably gain most insight by following Intel manuals first to understand the power states and energy management. This will highly vary between architectures. A badly behaving app can have a much bigger impact on Haswell than on an "old" Core 2 machine.

Use of other resources, such as the audio system, doing disk I/O or using USB devices may be also factored in. A likely accounting method would assign to your application all of the energy use needed by the resources your application uses exclusively (say a custom USB device, access to an otherwise powered-down audio syste), and do some sort of pro-rating for shared hardware.