This method should do the trick:
Acad::ErrorStatus AcDbCurve::getClosestPointTo(
const AcGePoint3d& pt, AcGePoint3d& ptCrv, Adesk::Boolean extend=false
) const;
Just like this:
AcGePoint3d C;
Acad::ErrorStatus es = curve->getClosestPointTo(B, C);
AcGeVector3d dirNorm(B-C);
The connection line between a point B and the closest point on a curve C is always perpendicular to the curve at point C if the curve is continuous at C.
Thomas Brammer ● Software Developer ● imos AG ● LinkedIn ● 
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.