From boot.h in the PICkit 2 Firmware source code:
#define RM_RESET_VECTOR 0x002000
#define RM_HIGH_INTERRUPT_VECTOR 0x002008
#define RM_LOW_INTERRUPT_VECTOR 0x002018
Program code execution starts at address 0x2000, interrupt vectors are at addresses above as well. You need to compile your code so it starts at 0x2000 and uses the vectors at 0x2008/0x2018.
Also, from the first part of boot_main.c:
void main (void) {
byte Temp;
word Counter;
//----------------------------------------
// Check Bootload Mode Entry Condition
//----------------------------------------
tris_PROG_SWITCH = 1; // RB4 Input
PROG_SWITCH = 1; // initialize port to 1
INTCON2bits.NOT_RBPU = 0; // initialize PORTB pull-ups on
Delay10KTCYx(600); // delay ~500 ms
if (PROG_SWITCH) { // is the push button pressed?
// if no, does program memory location 0x7FFE contain 0x55?
Temp = * ((rom far char *) 0x7FFE);
if(Temp == 0x55) {
_asm goto RM_RESET_VECTOR _endasm
}
From this you can see that in order for the bootloader to recognize that firmware exists and vector to 0x2000 on a reset, you must also write value 0x55 to program memory address 0x7FFE when writing your program via the bootloader.