Early pistol swords and knives were mostly used in Germany and France by hunters, as a secondary backup weapon to their hunting rifles. The image below shows a combination of a hunting knife with a wheel lock pistol dated to 1546.
Image licensed under Creative Commons Attribution-Share Alike 2.0 Generic License from user Unforth at wikipedia.org.
Click on image to enlarge.
This weapon was made in Germany and is now to be seen in the NY Metropolitan Museum collection. Note that the pistol barrel is located entirely on the back of the blade.
Combination of a wheel-lock mechanism with a sword has been in use since at least the 16th century. Since swords were traditionally much more expensive to manufacture than axes, knives, spears etc. and wheel-lock mechanism was also more expensive than other firing mechanisms, such weapons were usually used by aristocrats. Since they could afford it, these weapons were usually heavily engraved and decorated as well.
German-made Riding Sword from circa 1575. This combines a rapier with wheel-lock pistol. Click image to enlarge.
In the golden age of piracy, a weapon that combined a flintlock pistol with a cutlass was used by pirates as well as navy officers, for boarding purposes.
The illustrations above show two such designs. The first is actually a replica of a French made cutlass-pistol. Both these examples feature a single-shot flintlock pistol attached to the side of the cutlass. Pirates would swing over to the victim ship and discharge their pistol first and then close in for hand-to-hand sword fighting. Since the same hand could discharge the pistol and hold the sword at the same time, this left the pirate's other hand free.
All the above weapons depicted here are single shot weapons. Somewhere during the 19th century, when revolvers started to become popular, several French, Belgian and German manufacturers such as Lefaucheux, Lepage, Dumonthier, T.A. Rauh & Co. etc. began to combine pinfire revolvers with swords. This allowed the user the option of firing multiple shots without reloading. Such weapons were never officially adopted by any military, but were very popular among officers in many European countries. In fact, in the Paris Exhibition of 1867, there were over 30 models of swords-revolvers on display.
The above is a Belgian made weapon from 1877. The revolver uses pinfire cartridges and the trigger is behind the hilt, as is the loading gate for this weapon. Unusually, the scabbard has a depression on the outside so that the revolver barrel stays outside the weapon even with the scabbard on. This allows the user to fire the pistol even if the scabbard is still on the sword.
The picture above is a weapon made by T.A. Rauh and Co. of Solingen, Germany. The revolver barrel is located parallel to the right side of the blade. As before, the revolver uses pinfire cartridges. This weapon was granted US Patent #52504 in 1866.
The picture above is a 30 inch long short sword made by E. Lefaucheux Co. of France, to the order of a Peruvian importer. As before, this uses a pinfire cartridge revolver. Incidentally, it was Eugene Lefaucheux's father, Casimir Lefaucheux, who invented the pinfire cartridge. Eugene Lefaucheux inherited his father's business as well as his mechanical talents. With a view to improving the business, he went to study in Liege, Belgium for a period of time. There, he learned the latest practical manufacturing techniques, as well as negotiation tactics with local suppliers. It was also in Liege (which was a hotbed for making cheap, unlicensed firearm copies at that time) where he saw clones of the Colt Pocket 1849 and Navy 1851 revolvers and was impressed enough to make his own revolver versions. His first patent drawing of 1854 looked very similar to a Colt Navy 1851 model externally, but his 1854 model used pinfire cartridges inspired by his father, instead of the old fashioned cap-and-ball muzzle loading mechanism of the Colt model. This meant that his revolvers were much more reliable, easier and faster to load and more immune to weather conditions than the Colt model. In fact, the Lefaucheux 1854 revolver was considered the most advanced handgun of that era. It was only a matter of time before he adapted his revolver mechanisms to be attached to swords.
Pistol swords were not as widely used mainly because of the expense. One more major issue was that the pistol mechanism would cause the sword to unbalance towards the hilt, making it harder to wield the sword. Furthermore, since the pistol was permanently attached to the sword, it became much heavier and therefore harder to point and aim as a pistol. So instead of gaining a 2 for 1 weapon, the user ended up with an off-balanced sword and a heavy pistol! This is why pistol-swords never really gained much popularity throughout the ages.