These towns are jumping off points to Florence. We walked to the train station from the port in LaSpezia and had to take a bus from the station to the port at Livorno. The trains run frequently to and from Florence although we had to transfer at Pisa when going from LaSpezia but it was direct from Florence to Livorno. The trip is 1 to 2 hours on the train so we stayed in Florence at a nice place, Hotel Montreal, near the train station for 50 Euros.
Forence is hot in the summer so take plenty of water or plan on buying a lot of drinks. Florence is a place you could spend days exploring with the many museums and churches. We went to the Uffizi. Make sure you make a reservation well in advance because it is crowded in the summer and there are long lines but the museum was well worth it. The Duomo and Baptistery were amazing as well as the Medici's residence. One day is just not enough.
The trains run about every 1/2 hour and are very cheap and efficient, however we heard that pickpockets frequent the stations. You can catch the same train to all three destinations for a few Euro's round trip. Pompeii is a short walk from the train station and I think this is true for Herculaneum. We went to Pompeii and spent a few hours wondering the streets. Pompeii is very large and requires a lot of walking. Take a lot of water if doing this in the summer. This trip is well worth it and is very interesting. It would be good to review some literature prior to going to better appreciate the site.