A real estate investment firm has acquired a seven-building office portfolio in Wellesley for $48.5 million, betting that properties serving medical and small professional services businesses will make for a stronger investment than other types of offices.