Valve was working on TF2.. but it took years to be completed. It started as a more serious military shooter and became the lovely cartoon version later.
Classic is the version that was ported to the Goldsrc engine (which, itself, is a descendant of the Quake 1 engine) as a stand alone game.
TF2 is the same concept as TF/TFC, but turned into a full fledged game with its own soul.