Mean-field approximations for heterogeneous networks