I have never used a pistol, ever.
The damage is too low. I just do not see what the point is in either the original XCOM or the remake.
Useful applications of the pistol
Snipers can use the pistol on a turn that they move and can be more accurate than a rifle at close range
Shotgunners can be more accurate at range
Characters that are out of ammo can keep firing instead of reloading on a critical turn
They make more sense in the remake (Lawton some good points). But when dealing with superhuman difficulty, every bit helps - even in the original.
In the original, they were tricky due to their lack of range and power, but still very useful for your grenadiers - using a rifle reduced your accuracy with grenades, and having a grenade in the other hand reduced your accuracy with the rifle. The same applies to other tools, like flares. It could also save lives when coupled with the med-kit - every action point counts when healing a bleeding soldier.
Less important, but still there - it was a backup weapon for your rocket-launcher guys. You're not going to be shooting rockets in the corridors and rooms of most UFOs, and a guy with a plasma pistol is much better than a guy with nothing. The pistol also fits in the belt - instead of taking valuable space in the backpack - meaning you could take one more rocket (or, in the case of heavy plasma, two rockets).
The default pistol was close to useless, lacking both the power and accuracy to be anything but annoyance to anyone but sectoids. However, this was also the reason for its use later on, because it made it incredibly awesome for training your troops, especially the rookies. Just keep that last muton alive, strip if of its weapons (panicking/stunning/mind controlling), make everyone switch to pistols, and enjoy the massive boost to your soldiers' firing accuracy and reactions :) Being rarely capable of even penetrating the armour (and just as importantly, incapable of penetrating your armour), it allowed a lot of shots to be fired and even to hit, boosting your skill training significantly for very little risk.
In XCOM: Enemy Unknown (and Enemy Within) a sniper with the Gunslinger perk can do a surprising amount of damage with a pistol. It gives +2 damage, making a pistol in their hands do as much damage as an assault rifle, without needing to be reloaded.
As you advance through the game, you can get foundry upgrades for pistols, further increasing damage, accuracy, and critical chance, making them really good backup weapons for your Assaults and Supports, and amazing backup weapons for your snipers.
A pistol is lighter, and therefore someone using one will run/move faster.