I came up with about 260 euro for the 2 of you with a combination of full fare, economy and super economy tickets. Includes round trip Malpensa-Milano Centrale, which are 12 euro each person each way. 75 euro full fare Milan Centrale-Venezia S.L. You don't want to mess with advance purchase tickets on your arrival day, in case of unforeseen delays.
The rest can be done by buying 120 days in advance and picking the right departure times that work for you and get the best price. For Rome-Riomaggiore and Riomaggiore-Milan, get advance super economy tickets to La Spezia Centrale on direct IC trains. The connection from there to Riomaggiore is a cheap (2.10 euro) regional train. Venice-Florence and Florence-Rome will be economy tickets on the fast Freccia trains. You might luck out and find super economy tickets if you buy as soon as they are available for purchase.