Rockets were developed not long after the invention of gunpowder. The Mysore Kingdom in Tamil Nadu (India) was the first to invent a formidable rocket, around the 1760's. Their use of iron tubes allowed for a substantial increase in velocity. Previously, rockets had been made of an organic material. Rockets tend to "squirrel" around when they are shot. To counter this, they added a stick to the rear of it. Most of us used bottle rockets when we were kids. Some veer of in one direction or another. Others go pretty straight. Mysore rockets were the same way. They were fired in quantities to target a specific area, or to increase the chance of hitting something. They weren't accurate, but neither was European artillery.
The Mysore were the first to adopt rockets as a major part of their strategy. They used them with effect against the British East India Company in the 1780's and 90's. A sword was fitted to the end of them, and they were volleyed into the opposing infantry. This was similar to the way that the Europeans would use muskets. The main benefit, though, was that they would continue to throw flames after they had landed. They had no detonation. The Mysore were able to blow up the Brits' munitions stockpile, swiftly ending the Second Mysore War. Targeting munitions would be one of their main uses when they were introduced in the West.
When the British defeated Mysore, they captured these strange weapons and reverse engineered them. They were introduced by the British in the Napoleonic Wars. The advantage that they gained was critical. Their main effect was psychological, so they eventually came to be used sporadically. They were, however, pretty good at starting fires. They were used by navies at short and medium ranges. Both the English and the Americans used them in the war of 1812: "... and the rockets' red glare, the bombs bursting in air, Gave proof through the night that our flag was still there".
Eventually, the stick on the end was centered instead of attached to the side. This gave a nominal increase in accuracy when the rocket lifted off. The advantages of using rockets in addition artillery were probably negated by the introduction of steel cannon in the later half of the century. William Hale invented a spinning rocket in 1844 that was much more accurate, eliminated the stick, and increased the range. Still you don't hear much about them in the later part of the 19th century.
The next major step wasn't made until 1914, when Robert Goddard proposed the use of a De Laval Nozzle for supersonic propulsion. The De Laval Nozzle was invented for the steam engine in 1888. "Modern" rockets are still are not very accurate. They are fired in volleys, not unlike Mysore's rocket swords. The effectiveness of handheld devices, like the RPG 7, greatly decreases with distance. For this reason, rockets have become largely obsolete in modern arsenals.
Fore more information, see: Mysorean Rockets, Congreve Rocket