The official statement from Sakurai is Brawl has 39 characters. Ivysaur, Squirtle, Sheik(which ironically was revealed first despite not having the core icon of the two on the CSS) and Zero Suit Samus are 100% characters programmed in. So are every Echo, no matter how lame they are(goddamnit, Daisy. Richter is slightly better, as noted some time back that his Fire move does affect at least once match up a tiny bit).
They are all separate characters, regardless of the CSS' design. Pokemon Trainer does not have his own actual ID Number for a reason. He's a 3-in-1 full character set. So are Pyra and Mythra, who were just listed as two characters.
The games do get odd, cause Smash 64 has tons of programmed separate characters as various NPC clones/enemies, while others are just changed gameplay states(Kirby Team has infinite of their respective B move they take from another character. This small thing no longer happens during Melee, so likely a bug in programming). Overall, there's 25; playable 12, Fighting Polygon Team members, Master Hand, Metal Mario, and Giant Donkey Kong. Later games make most characters except the core Fighting Teams(Polygons, etc.) into truly different characters. Whereas Giant DK and Metal Mario are the normal playable characters, but with a gameplay state changed to make them look like a special NPC. Dark Link is the only otherwise example of where he has an unusable costume color(pure black model).
There's a lot of trivia you can find related to this, though I lack the data to say how many fully programmed characters are in after Melee. Nana included(until she's actually playable via costume slots, at least. Though I don't know if you're completely playing as Nana or just a Nana-designed Popo. Either way, Ice Climbers are two programmed characters to begin with. Due to the hefty CPU Nana requires. I can't say if the other ones like the Pikmin(each type?) and Luma are true CPU programming or not. Probably so, but I lack the files).