Marcel Kittel won the second race of his season on Monday after the Katusha-Alpecin rider made the most of his former lead-out train on the run in to Fano before pouncing to claim victory at the end of the 153 kilometre sixth stage at Tirreno-Adriatico.
"The guys did a great job and I'm proud of the team", said Kittel, who also won Thursday's second stage at Follonica.
Richeze finished third with Gaviria suffering a broken left hand which requires surgery and could sideline him for a month, his team said later.
Thomas lost 36 seconds to the leaders following a mechanical failure during the fourth stage of the seven-stage race.
The Polish beat BMC Racing's Damiano Caruso (Italy) and teammate Gerraint Thomas (Britain) into second and third resepctively on the final general classification.
Dennis was quickest on the 10-kilometer (6.2-mile) individual time trial in San Benedetto del Tronto. Jos van Emden (LottoNL-Jumbo) came closest to toppling the Australian national champion but was four seconds shy and had to settle for second place.
Mads Pedersen (Trek-Segafredo) set an early best time of 11:22, a mark that had him sitting for more than half an hour in the hot seat before Dennis came along and knocked him from the top spot.