Because they are visual binary we can estimate the distance between the stars. Then because we know distance we can calculate each star's mass. This is done by observing the period of orbit and seeing how much the smaller start makes the bigger star oscillate by it's gravitational force.