The proj.4 software provides a command line program that can do the conversion, e.g.
LAT=40
LON=-110
echo $LON $LAT | cs2cs +proj=latlong +datum=WGS84 +to +proj=geocent +datum=WGS84
It also provides a C API. In particular, the function pj_geodetic_to_geocentric
will do the conversion without having to set up a projection object first.