It sounds like you have a 3 conductor wire at the box. You should also have a ground wire, unless the wires are the old shielded cables.
You'll need to determine what the black and red wires are doing. If you attach the white and the white, you'll need to see if the black or red wire works with the switch, but not both. Also make sure the fan light is on at the pullchain when you are testing the thing.
The best thing to do is to use a multimeter on the 3 wires if you aren't sure.