For all your transport needs in Switzerland use the railways website,
http://www.cff.ch. It will include all relevant types of transport, rail, but also buses, boats, mountain railways, if they're needed.
Bern to Gruyères is nice, but I wouldn't do anything too fancy (though if you have time, Fribourg is very attractive). From Gruyères to Lausanne, go the long way round using the MOB which takes you through the mountains to Montreux (on the cff website just put via Montreux to get a schedule for that itinerary).
Gruyères is a bit kitsch but does it rather well. Go to the cheese factory at the bottom of hill by the station. Plenty of restaurants in the village which is very touristy.