Follow a decent questing guide or just grind. You should be able to make level 40 in a weekend, depending on class of course.
I'd guess:
Warrior, Rogue, Druid 2-3 days to 40.
Mage, Warlock, Shaman, Hunter 3-4 days to 40.
Priest 5 days.
Paladin 5-6 days.
Of course this assumes you prepare properly before hand (potions, bandages, food, drink, buffs, and other consumables), so for a new account, add 1/2 days - but really it isn't that hard to learn how to grind, so join a server with friends if possible so they can foot you some gold for potions and armours as you level up.