There are two options for flashing firmware to the ATmega8U2:
DFU is done via the standard USB cable on the Mega using the Atmel FLIP software.
The other option is to use an ISP programmer to flash the firmware to the ATmega8U2. There's a 6 pin ICSP header next to the ATmega8U2, just like the other ICSP header next to the ATmega2560 on the other end of your Mega. You can connect an ISP programmer to that header and then use AVRDUDE to flash the firmware to the ATmega8U2. If you don't own a dedicated ISP programmer you can use an extra Arduino board as an "Arduino as ISP" ISP programmer. It's similar to the process you would use to burn a bootloader to your Arduino's main microcontroller except that it's not possible to do this process via the Arduino IDE. You need to run the appropriate avrdude command from the command line but you can use the copy of AVRDUDE that's included with the Arduino IDE if you like.