You shouldn't have to rewrite the Arduino Due bootloader - you just need to write a program that can act as USB HID using the native USB port, and upload the program to the Arduino Due. You can use the Due's programming USB port to do the upload.
But here's info on the Arduino Due boot process:
The Due has a ROM bootloader that listens to the USB native port and Serial port 0. You can talk to the ROM bootloader via USB directly by resetting the SAM3X8E and using the native port. But I've not found that method to be very reliable. The more frequently used programming port is connected to an Atmel AVR 16U2 microprocessor acting as a USB-serial converter, connected to the SAM3X8E serial port 0. The Arduino 1.5 IDE can talk to the 16U2 using the Bossa command (bossac), reset the SAM3X8E, and upload new programs to it it. This page explains the Arduino Due's bootloader in detail.
If you're interested, here's the source code for the 16U2 AVR USB-serial converter.
And here's Bossa - the Due's command that corresponds to avrdude.
Using bossac (the Bossa commandline tool), you can upload code the SAM3X8E, using the builtin ROM bootloader.
On creating HID devices:
Here's a link to an Atmel application note that has example code for creating a program that can act as a USB HID keyboard:
http://asf.atmel.com/docs/latest/common.services.usb.class.hid.device.keyboard.example.sam3x_ek/html/index.html
The source code to this example is the in the Atmel ASF packages - unfortunately, a large download. Here's where to get it:
http://asf.atmel.com/docs/latest/download.html
Once you download it, the source code the HID keyboard example is in this folder:
common/services/usb/class/hid/device/kbd/example/sam3x8e_arduino_due_x
Here's a list of the other app notes, with examples of other kinds of USB and HID devices. Look for the ones that are for the Arduino Due:
http://asf.atmel.com/docs/latest/applications.html
Just to clarify, you purchased an ATMega328P microcontroller with the Ardunio Bootloader already programmed into it? if that is the case, it sounds like the ATMega16u2 interfacce chip on your uno is bad. Its sits between the usb connection and the AtMega328 and convert usb signals to TX and RX serial data onto pins 2 and 2.
You could measure your 5v on the board and make sure its still good. If its good, its probably a bad board. The 5V may have gotten a spike from the motor.
Best Answer
After reset (either a hard reset or an instruction reset) the program counter returns to 00h. Whatever instruction is located there then gets loaded into the processor.
This is dependent on what kind of I/O (or system architecture) you have attached to the processor. If you have a ROM attached (with the enable lines configured right) then it will load the instruction from 00h into the processor and start your program or OS on the ROM.
With the At89s52 you need to program the ROM