The basic formula reduces down to:

NCO Value = (Frequency * 2,097,150) / Fosc

Building the NCO Calc in Visual Basic, the behind-the-scenes math was:

NcoDec = (Freq * 2.09715) / Fosc
NcoDecR = Math.Round(NcoDec, 3)
FreqDn = Math.Round(((NcoInt * Fosc) / 2.09715), 4)
FreqUp = Math.Round(((NcoInt1 * Fosc) / 2.09715), 4)

There's a bit of other code in there, but that's the math.