You need to make (or get a hold of) a digital PLL. A digital PLL has 2 inputs and 1 output (I'm excluding uncommon features).
You need to make an audio amplifier, and use the speaker as an input, then connect the output of the amplifier to a VU meter circuit. You can find one at talkingelectronics.com.
When you done that, you made a color organ.
Now instead of an LED, connect the color organ's output to any input of a digital PLL.
Create an oscillator circuit, and make it's frequency something you will use. You may want to replace a resistor with a potentiometer so you can fine-tune the frequency. Connect the output of the oscillator to the 2nd input of the same digital PLL.
Now depending on how the PLL is made, the TRUE (logic high) output will either indicate that the two frequencies are the same, or they are different. You can easily add an inverter to change that.
Then you can connect the output to an input of the PIC.
In your PIC microcontroller, you need to write a program that detects when the pin that the output is connected to is the state you want it to be.
Nigel has a ton of information about programming a PIC, so he can help you on that if you need it.