I don't know how Smith and the Robot came into the picture, they weren't in the original pilot reel. Jonathan Harris' constant "Special Guest Star" billing in the main title, for the entire run, must have been orchestrated by a brilliant agent. At the time, the only thing I recognized Harris from was his hotel manager role on The Bill Dana Show.
Before Lost in Space ever arrived though, there was a Gold Key comic book around for a couple of years called Space Family Robinson. They were not the characters of the tv show, but there was a mom and dad and two kids. After the series appeared, some sort of arrangement was made, as the comic was rebranded as Space Family Robinson: LOST IN SPACE, though it still wasn't about the tv show.