Bridging the gap between stellar-mass black holes and ultraluminous X-ray sources