I know that he served in the Florentine Republic but which social class did that constitute at the time?
I don't know how much you know about late medieval/early renaissance history, so feel free to ask me to clarify any point.
Society in Renaissance Northern Italy was not analogous to society in renaissance France, Spain and England. Many cities, including Florence was at the forefront, were run as "Free Communes," a primitive form of Republican Democracy (some cities were ruled by a lord, but very often, the cities under the lord were granted much autonomy. I can go into detail but will spare you).
How this democracy was shaped varied from city to city. However, for the most part, laws were decided by a council called the "Signoria," an assembly where all the city's most important families sent a representative. In Florence, where machiavelli lived, I think the families in the Signoria numbered around two or three dozen. Oftentimes, guilds (a kind of association) of craftsmen and/or merchants such as bakers, cheese makers, or other professions could each send a representative.
Members of families who were represented in the Signoria could decide to run for a public office (I believe Machiavelli was Gonfaloniere della Giustizia, who was in charge of running the city's courts), although the specifics of how this worked varied from city to city.
Members of the Machiavelli family had held multiple offices over past generations, this would mean that his family were considered well established members of the Signoria, that is to say, well established members of the ruling class. Maybe they weren't as wealthy or famous as some other families, but they were definitely players in local politics, and would have been well respected by everyone.
You might be confused because you're looking for an analogy with what you know of medieval society, where a King divided his land amongst a dozen Dukes or so, who then divided land amongst Counts, and so forth. By the year 1000, this system had broken down many places in Italy, for reasons I love explaining but will spare you. Although many families in the Signoria of the various cities held titles and land outside the city, by Niccolò Machiavelli's time, many families held nothing apart from their home in the city (and their vast business investments). By Niccolò's time, the Machiavelli family was also one of these, although his family may have descended from feudal landholders.
To make it even more complicated, this system, called "Communal", was breaking down around Machiavelli's time, as increasingly, single families would dominate the others in the Signoria, and eventually become powerful enough to make it redundant. The Medici family are the prime example.
Edit: typos