The Wikipedia page for Bourgeoisie is informative, and worth the read.
Strictly speaking, there was no equivalent of middle, upper, or lower classes (in the modern usage of the terms) prior to perhaps the 17th century. The bourgeoisie were the wealthiest segment of commoners under feudal aristocracies, all the way back to the 11th century: tradesmen, merchants, manufacturers, and the like, who developed a certain amount of social and economic power under the guild system. In that era, there were:
- Feudal (titled) aristocrats, who owned land and earned money through rent and taxation
- Agricultural peasants, who had no political status and owed fealty to the feudal lord who owned the land that they tilled
- The bourgeoisie, who had a certain freedom as citizens within urban areas
- The beginnings of the proletariat, who had a similar relationship to the bourgeoise that peasants had to the landed aristocracy
In the Marxist view, the industrial revolution wasn't merely a technological revolution; it was a political and social revolution as well. The shift from a primarily agricultural society (in which the landed aristocracy owned the means of agricultural production) to a primarily industrial society (in which the bourgeoisie owned the means of industrial production) shifted the bourgeoise into a position of power equivalent to the old aristocracy, while the rural peasantry left the farms and transformed itself into the urban proletariat. That urban proletariat then conceptually divided itself into lower, middle, and upper classes, representing different statuses of employment by the bourgeoise.
The bourgeoisie themselves were never lower, middle, or upper class; they became the owning (capitalist) class, set off from and above the lower, middle, and upper classes of workers.
The capitalist class has done a wonderful job obscuring its own existence, trying to make it appear as though it is merely the nose-bleed section of the upper middle class, and that anyone can work their way up to be part of that modernized bourgeoise. But it still carries that protectionist 'guild' mentality, where the interests and welfare of the class come first and foremost. Thinking of the bourgeoisie as middle or upper class is at best mistaken, and at worst disinformation.