I've not read any books of Middle-Earth bar The Hobbit, so my knowledge of the setting is severely lacking. From the films and what research I have done, I've found many references to kings, some (perhaps only one) of princes (thinking of Dol Amroth), and "lords" such as Lord Elrond. I am wondering, if there is any other nobility in the writings of Tolkien other than princes and "lords" (I put lords in scare quotes because I am aware that dukes and earls and so on are lords, and even kings can be called lords, but characters such as Elrond are described as nothing more than lords). Did Tolkien ever write a duke, or an earl, or count or baron or anything such as this?
Contrary to what seems widely believed, Middle-earth is actually not a feudal/medieval society, so one shouldn't go looking for feudal/medieval titles in it.
Some parts of it may well resemble such a society, but on the whole it's well documented (e.g. in Letters) that Tolkien's primary source of inspiration was Dark Ages Germanic mythology.
Duke, Count and Baron are all derived from Latin words, via French (duc, comte, baron) and as such have no place in Tolkien's work. Earl on the other hand is Germanic, related to Scandinavian jarl, and was used in the name Eorl the Young.
Another familiar title is used in the name of Theoden's father: Thengel, related to thegn/thane.
Gondor has knights, but despite that we have no indication of "Sir" being used as a knightly title. Remembering the device of feigned-translation employed by Tolkien, we can speculate that the word "knight" was just used as a familiar reference point but perhaps not intended to evoke modern clichéd images of medieval knights.
In fact Tolkien (in note 17 to Disaster of the Gladden Fields) states that the word "knight" is used to represent Quenya roquen, which contains roch "horse" and quen "person", i.e "horseman". This is indicated (in the same note) to be a purely military rank (above that of ohtar "warrior, soldier") rather than a noble title.
In any event, neither Gondor nor Rohan were medieval societies, per Letter 211:
One title that Gondor did have was Steward, but that was a very particular rank with a specific purpose rather than a title that could be earned or granted.
The Shire had Thains, Pippin was made a Knight of Gondor (implying the existence of other such Knights) and Rohan had Marshals of the Mark (e.g. Eomer). All of those are noble titles of one kind or another.
In the Silmarillion it is stated that after the days of Earendur that the Men of the Westernesse, the Dunedain of the North, became divided into petty realms and lordships. Therefore these terms could apply... The reference is only useful in that the term 'petty' implies a disorganized and varied structure of hierarchy which could be analogous to such titles.