The hosts could have gone ahead as early as the first minute when Firmino found space from a free kick with a header, but he could only pick out Jaroslav Drobny in the Hamburg goal.
Three minutes later, however, they were in front. Hoffenheim broke with pace and Kevin Volland played the final ball for Firmino to sweep in from inside the box.
David Abraham came close to doubling the home side's lead after 12 minutes, but he put a header from a Sejad Salihovic cross narrowly wide.
Hamburg started to come back into the game but just before half time Hoffenheim struck what was the crucial blow, as Niklas Sule thumped in a header from a Salihovic corner.
Then as the visitors started to press forward for the goal they needed, Hoffenheim scored again on the break through Andreas Beck to wrap up the victory.