The size is not about physical boundaries the creature occupies, but to area the creature effectively controls.
The Size Categories table shows how much space a creature of a particular size controls in combat.
Which means, you and the horse are somewhere inside that area. And have control over it.
Moreover, it also means that unlike our mini's the creatures which stand frozen in whatever pose, our characters are are moving within the squares they occupy. Dodging missed attacks (That's why Dex is used in figuring out AC), take a step forward (inside that space) to strike, turning in the square to reach the opponent (5e doesn't have facing, you simply occupy the space). Since this moving around doesn't leave the space, it isn't movement; but the rules are meant to simplify real life.
Logical Assumption From Above
It would be reasonable to assume that you attack from the creature you've mounted's space. Your range would be the adjacent reach from the controlled area (adjacent squares if you have a 5 ft. reach and are using the grid variant rule) of the mount. As the mount could turn in the square at zero movement/skill check cost to bring you closer to the target.
Official Ruling (at the time) | Designer's Intent
However, there is now an tweet from Jeremy Crawford, which at the time was considered an official WotC ruling and now is just an insight into the designer intent, which is simply:
Being mounted doesn't change your character's size.
This would mean that rider can only attack from the space the rider occupies, which is more realistic but depending on the minis used, might be slightly harder to track.