www.analyticcycling.com has some formulas for estimating power, using a bunch of simple variables (go to "static forces", then "power given speed"). This method takes the least amount of investment.

Other than that, you need a power measuring device that estimates Force using either strain gauges (power hub, or crankset), or wind/altitude change, piezoelectric devices, or by powering an electric motor (computrainer). There's also other resistance trainers that have power estimates charts using wheel speed (Krietler rollers, Kurt Kinetic, or 1Up trainer, etc.), which were created using a power measuring device.

All those devices are expensive.

The important formula for power, that most reflects cycling (mechanical power) is:

Power = (T*2*pi*rpm)/60

where T=Torque, pi=3.14, rpm = pedal rpm

Torque has to be in Newton meters. Rpm is pedal revs per minutes. RPM is easy to measure, the trick is getting torque.