Reprinted from Gutspill's post:
First of all- how to play infected. open the developer console and type in "sv_cheats 1"(options, keyboard, advanced, and enable developer console) then type in "director_no_human_zombies 0". or it will be something like that. Then, you should be able to just call a vote to restart the campaign and voila! your on the infected team! You should be able to type in "director_force_versus_start" to make the bots go out of the safe room.
You can spawn yourself as whatever you like while in spawn mode by typing "z_spawn hunter". It doesn't have to be hunter, smoker, boomer, and tank will also work.
Other useful (fun) commands-
director_no_death_check 1 -- the singleplayer game will continue regardless of whether you die.
director_no_survivor_bots 1 -- pretty self explanatory, but it disables survivor bots.
director_no_mobs 1 -- zombie hordes will not spawn.
give weapon_shotgun -- gives you a shotgun. (weapon_smg, weapon_rifle, weapon_autoshotgun, weapon_pipe_bomb, weapon_molotov, weapon_hunting_rifle also work)
nb_blind -- all AI zombies will not attack unless you touch them.
god 1 -- all survivors will be invulnerable.
noclip -- good old noclip.... you can fly around the map!