A real estate investment firm has sold a Somerset County hotel for $30 million, a decade after acquiring the property through a partnership with a former hospitality company.