For the 555 circuit, look at the applications section of the 555 data sheet. Transpose the free-running oscillator equation to solve for C as a function of Freq.
For the other circuit, I would have to know what the code is doing with AN0, RA2 and RA3? Likely, it is measuring the time it takes to charge/discharge the capacitor to a given threshold as defined by the internal comparator.
I just looked at the data sheet. That is a rather poor sensor. Its capacitance is effected by the measurement frequency, the ambient temperature, and by-the-way, slightly by changes in humidity. Good Luck...