Bob was one of the nearly 3000 Insecticon Swarm members that were deemed too feral and mindless to be of any practical use to the Decepticons. The Swarm was therefore simply released on Cybertron in order to effectively eradicate any possible remaining opposition to the Decepticon cause.
Sunstreaker and Ironhide would later take it upon themselves to wipe the Insecticons Swarm off the face of their planet. When Sunstreaker found a lone Insecticon that had wandered away from the Swarm, he found that it was surprisingly easy to train the creature. He eventually named the Insecticon "Bob" and used him to track down any of the remaining feral Insecticons.
Bob was created by Guido Guidi and Mike Costa. He first appeared in 2011's The Transformers #20.
Originally, Bob was going to be called "Spike", in order to create a small meta-joke of how certain Transformers knew another someone by the name of Spike. Costa was told this would be too confusing however, and IDW named the Insecticon "Bob" instead.
Bob has quickly managed to amass a considerable fan-base. Fans are currently clamoring for a toy version.