Your question is simple but a full answer is complex. The simplest answer is to point to Part 2 (especially chapter 4) of Wilson and Papadopoulos (2004), or the recent review by Debraux et al. (2011), or the paper by Martin et al. (1998). However, even these papers do not cover approaches that take better advantage of the data available from modern bicycle computers and GPS units. Some background on the power-drag equation will help you understand why there are so many different ways (with accordingly different levels of accuracy, precision, difficulty, and cost) of estimating drag.
The equation to convert speed to power is well-understood. Total power demanded has four parts:
Total power = power needed to overcome rolling resistance +
power needed to overcome aerodynamic resistance +
power needed to overcome changes in speed (kinetic energy) +
power needed to overcome changes in elevation (potential energy)
Of these, the simplest piece is the power needed to overcome changes in elevation. The power needed to account for the change in potential energy, and to overcome changes in speed are straightforward:
watts(PE) = slope * speed in meters/sec * total mass * 9.8 m/sec^2
watts(KE) = total mass * speed in meters/sec * acceleration
There is a small part of the KE component due to moment of inertia in the wheels but for bicycles that tends to be small and we often ignore it. However, the equations needed to describe the rolling resistance and aerodynamic resistance are a bit more complicated. The article by Martin et al., cited above, gives more detail but if we can ignore wind then the aerodynamic component simplifies to
watts(aero) = 0.5 * rho * CdA * (speed in m/s)^3
where rho is the air density in kg/m^3 and CdA is the drag area ("A" is the frontal area and "Cd" is the coefficient of drag; CdA is their product and can be thought of as the "equivalent" area of a cube held perpendicular to the direction of the wind with a face of area A).
Finally, the power needed to overcome rolling resistance (which includes tires, tubes, and bearing friction) is
watts(RR) = Crr * total mass * 9.8 m/sec^2 * speed in m/s
Crr is the coefficient of rolling resistance.
Now, if you go to an online calculator like the one at Analyticcycling.com you'll see that you must provide values for rho, Crr, Cd, and A; then, given a particular value of speed and slope, it will calculate power. It's easy to find online calculats for the air density, rho, but much harder to find estimates of Crr and CdA (or separately, Cd and A).
The easiest (but most expensive) way to estimate CdA is in a wind tunnel. There, an object is mounted on a scale (basically, a very precise and accurate bathroom scale), wind at a known speed is applied, the air density is measured, and the total force on the object is measured by the scale. Watts are force (in Newtons) * speed (in meters/sec) so force (in Newtons) = watts/air speed = 0.5 * rho * CdA * (airspeed^2). The tunnel operator knows rho, knows airspeed, and the expensive bathroom scale measures the force so you can calculate CdA. Wind tunnel estimates of CdA are considered the gold standard: when performed in a good tunnel with experienced operators, the measurements are precise and repeatable. In practice, if you want to know the Cd separately, you'd measure the frontal area A with a digital camera and compare it to a digital photograph of an object (like a flat square) of known area. As an historical aside, nearly 100 years ago Dubois and Dubois measured frontal area by taking photographs of a person and a reference object, cutting out the photos along the outlines of the object, and then weighing the cut-outs on sensitive scales.
However, the resistance in tires, tubes, or bearings are not affected by air speed, so one cannot estimate Crr from wind tunnel data. Tire manufacturers have measured rolling resistance of their tires on large rotating drums but they cannot measure aerodynamic drag. In order to measure both Crr and CdA, you need to find a method that measures both and allows you to differentiate between the two. These methods are indirect field estimation methods and they vary a great deal in their accuracy and precision.
Until the last 20 years or so, the most common indirect field method was to coast down a hill of known slope and to measure either maximum speed (also known as terminal velocity) or else the speed when passing a fixed point on the hill. Terminal velocity doesn't let you differentiate between Crr and CdA; however, if one measured speed at a given point and were able to control the "entry" speed at the top of the hill, you could then test at different entry speeds and get enough equations to solve for the two unknowns, Crr and CdA. As you might expect, this method was tedious and liable to poor precision. Nonetheless, many ingenious alternatives were explored, including coasting down wind-free corridors or inside large airplane hangars, and measuring speed to relatively high precision using "electric eyes" or timing strips. Some of these methods are described in the review by Debraux et al., cited above.
With the advent of on-bike power meters, new opportunities emerged to measure aerodynamic and rolling drag. In short, if you could find a flat wind-sheltered road, you would ride at a constant speed or power on the road; then, repeat at a different speed or power. The requirement of "flat and wind-sheltered at constant speed" meant that you could ignore the PE and KE components of power and only had to deal with the rolling resistance and aerodynamic components so the overall power equation simplifies to
Watts = Crr * kg * g * v + 0.5 * rho * CdA * v^3; or
Watts/v = Crr * kg * g + 0.5 * rho * CdA * v^2
where g is the acceleration due to gravity, 9.8 m/sec^2.
The latter formula can be easily estimated by linear reqression where the slope of the equation is related to CdA and the intercept is related to Crr. This is what Martin et al. did; they used an airplane runway, averaged the runs in both directions, and measured barometric pressure, temperature, and humidity to calculate rho, and measured and corrected for wind speed and direction. They found that the CdA estimated by this method agreed to within 1% of the CdA measured in wind tunnels.
However, this method requires that the road be flat and that speed (or power) be constant over the length of the test run.
A new method for estimating CdA and Crr has been developed that exploits the recording capability of many modern bike computers and bicycle power meters. If one has moment-by-moment recording of speed (and optionally, power) then you can directly measure changes in speed so the KE component of power can be estimated. In addition, if you ride around in a loop, the road need not be flat since you know that upon returning to the start point of the loop the net elevation change will be zero so the net PE component will be zero. This method can be and has been applied to coasting down hills of known net elevation change (that is, you don't need to have constant slope, and if coasting you know the power is zero). Examples of this approach can be found here and here and, when performed carefully have been shown to agree with wind tunnel estimates of CdA to well within 1%. A short video presentation on the method can be found starting at about the 28:00 mark here.