Copy protect program code in PIC microcontroller
Figured out something myself.. 

When I program the device using MPLAB X IDE (using the Make and Program Device button) in the tool bar, with CP bit ON and try to read the program using MPLAB X IPE, it seems to be copy protected. I get an output hex file with all 3FFFs.

However, when i compile my project in MPLAB X IDE, generate an output hex file, use the hex file and program it to my device using MPLAB X IPE, and read the device to output the hex file, i'm able to download the working hex file from the device, even though it is copy protected. 

Not sure if it is a bug in MPLAB X IPE or am i doing something wrong.
I'm using version MPLAB X IPE v4.01

Just though of posting it here, as it may be helpful for someone facing similar issue. Thanks.