Hi, i would disable the brown out detection,
and since you are using the crazy USB framework from microchip you should do as they say and place all you code inside the User.c/.h because you are using a framework not just some functions.
Also, i find strange that your pic is running that while you placed because the ProcessIO has a loop at some point, to keep processing USB requests and your user code...
I'm new to USB with PICs, i have posted a thread about the USB function on this pic, search for it, it has some links to some projects that exclude the microchip framework and use a simpler set of functions.
In my case the PIC initiates and when i enable the USB module my windows detects a USB device but it can't get the vendor ID from the PIC, don't know why yet...
Well, i hope this helps, somehow...