Miguel Abensour's 'Democracy Against the State: Marx and the Machiavellian Moment' covers a fascinating topic.
Machiavelli rather than just providing a political guidebook to evil 'The Prince' has been understood also as a republican radical. In his 'Discourses on Livy' he discusses Levy's history of ancient republican Rome, while the discourses cover some of the same ground as 'The Prince' the text from Machiavelli is about how to defend a republic. Machiavelli was a promoter of democracy, in the form of his own beloved Florence, which for a time was a democratic city state. Well Ok for Mac and the ancient Romans and ancient Greeks, plenty of people were excluded from the democratic system!
A source on all this The Machiavellian Moment by Pocock.
Spinoza owned a complete works of Machiavelli and studied him with great interest. Marx made notes on Spinoza's Tractatus Theologico-Politicus but not I think on Machiavelli. Marx studied ancient Greek philosophers who influenced Spinoza but the stoics are another story!
In brief Marx and Machiavelli and Spinoza were concerned with radical democracy based on the republic but democracy moves beyond the state form.
I didn't find Abensour's book very accessible but he does cover an important set of linked concepts and yes the State isn't the last word in democracy.
Again this links in with the practical pragmatic work of the Ostroms....and political pragmatism, not in the sense of how to win but how to deal with actual problems rather than setting up universal abstract values....links the Ostroms with what might be seen as a Spinoza/Marx/Machiaveilli approach.
Machiavelli examined the practical strategies of a Prince or a people defending a republic, the Ostroms rejected win/lose politics but studied the practical governance needed for a commons and practical questions around ecology and governance.
I would not start in this inter locking area by reading Abensour but he poses the relevant questions.
On republics, Ostroms and Machiavelli have a look here!