This isn't really a software question,
in the data sheet page 68 you will see the block diagram that involves the clock. Here we can see that the internal oscillator is at 16MHz, we also see we have a PLL available, so we can multiply our internal or external clock to achieve the 32MHz.
From the same data sheet -
Program the PLLEN bit in Configuration Words to a '1'
Write the SPLLEN bit in the OSCCON register to a '1'. if the PLLEN bit in Configuration Words is programmed to a '1', then the value of SPLLEN is ignored.
You can see how to access OSCCON in page 37.
Then find other SO questions about how to write directly to memory in an embedded environment. HINT