These were entities quite different from both modern governments and modern economic corporations. These wielders of coercive power for profit combined the efficiency of private enterprise with the often ruthless coercion of government.
In the Roman Republic there were a number of corporations that were granted various kinds of political power. The most notorious were the publicani, the ruthlessly efficient tax farmers. Tax farmers were private contractors to governments or other coercively funded entities (such as colonial corporations, examples of which we will see below). Through history tax farmers have been famed and reviled for their efficient operations and ruthless treatment of taxpayers. The publicani, for example, deployed crucifixion and other forms of torture to extract financial information from their victims.
Tax farmers were, however, at least more honest than modern tax collectors. Tax farmers knew who their customers were -- governments or other coercively funded organizations. Like any other collection agency their customers were the creditors, not the debtors. They never propounded the pathetic mythology of some modern government tax collectors that their quite involuntary debtors, rather than their respective governments, are their "customers".
It is not well understood by Romanist moderns that monarchy was based, not primarily on Burkean romantic worship or the divine right of kings, but rather on the political property rights of an individual and his heirs. The laws of inheritance for a monarch were usually the same as those for land. Furthermore, at most places and times the monarch did not have a monopoly of political power, but rather by prescription or grant many other entities -- nobles, burghers, and corporations chief among these -- also held political property rights. Modern "titles" are the shell of a system that once involved extensive political property rights. As I described in my paper "Jurisdiction as Property", the most basic aspects of the medieval and Renaissance English legal system -- from which much of the modern writs, common law, and constitutions of England, Commonwealth and United States legal systems are derived -- were the laws that defined the rights and trespasses involving political property.
After a long lapse from the records of history, the Roman corporate form reanimated in the form both of independent cities -- municipal corporations that gave rise to republics -- and in forms like the Genovese maone and similar organizations in other late medieval Italian republics. The maone issued securities that acted much like stock shares, effectively paying dividends, although technically they were treated as debt instruments rather than ownership shares. They engaged in colonial conquests and administration, tax farming, or other subsets of governmental functions. A fuller account of the maone and their role in originating the modern corporation can be found here.
Sir Francis Drake, commander of joint-stock navies.
There is also a long history of armed forces for profit -- of mercenaries, private escorts, privateering, and sheer piracy. The main colonial companies, such as the East and West India companies of Britain, the Netherlands, and other colonial powers, deployed their own naval forces to protect their own fleets and on occasion to attack rival shipping. Among the first English joint-stock corporations were the temporary joint-stock companies set up by Drake and Hawkins to trade with the Spanish colonies (from the Spanish point of view to smuggle) and raid the Spanish gold and silver fleets.
Despite their profit motive, which put a premium on trading and raiding rather than defense, these private navies also successfully defended England. The battle of against the Spanish Armada was won, not by the Royal Navy (which did not yet exist), but by the joint-stock naval corporations of Drake and Hawkins. Drake's circumnavigation of the globe in 1577-80 was also funded by a joint-stock company created for the purpose. The profits came from trading/smuggling and privateering against the Spanish Main.
Most of the British colonies overseas (and many of those of Brtitain's rivals) were organized as corporations for profit, and most of these at one point or another issued stock. The political consequences of such corporate colonies were highly controversial and highly varied. In America, the corporate charters guarunteed "the rights of Englishmen"; that and a large frontier (and thus low exit costs) produced a very libertarian political system. Some American charters, such as the Massachusetts Bay Company, guarunteed that all freeholders of land within the corporation's land grant could vote on the corporate by-laws, which effectively became the laws of the land. This set the stage for two of the most distinctive characteristics of the later United States -- both its democracy (in contrast to their status in England, most early English settlers in America were landowners ("freeman") and thus entitled by charter to vote) and its written constitutions enforced by judicial review (because the charter -- in modern corporate parlance the articles of incorporation -- trumps mere legislation -- in modern corporate parlance the by-laws).
Charter of the Massachusetts Bay Company, 1628
In Africa, by sharp contrast, the main business was slaving, and the charters of the African corporations authorized them to wield martial law, which they did with ruthlessnes. The most infamous of these African companies operated, however, after the era of individual slavery had ended. Instead of overt slavery the Congo Free State instituted a system effectively worse than slavery -- a tax system based on in-kind payments of rubber. The barbarous cruelty of the resulting system was immortalized in Joseph Conrad's Heart of Darkness.
In between these political extremes, the East India Companies and many other colonial companies operated across the globe, at first assisting local entities in military, tax collecton, and administration, but eventually taking over these governmental functions and reaping often immense profits as a result. They brought literacy and very efficient and modern administration but also often engaged in an exploitation that was widely percieved as so ruthless that the East India Company became profoundly unpopular and was eventually nationalized.
Administration by the colonial companies was usually far more efficient, for example in terms of European manpower deployed, than the later administration by the governments of European powers when these companies were nationalized in the 19th and 20th centuries. By the end of the 18th century these companies had become highly unpopular in government circles. The rise of democracy and the Romanist ideology of the monolithic state spelled their doom. Ideologists and scholars as varied as Adam Smith, Edmund Burke, and Karl Marx railed against the depradations of the colonial corporations. For Marx these epitomized the evil of capitalism generally, whereas Smith and Burke were careful to distinguish the wielding of coercive political power, which they found particularly destructive in this form, from the wielding of voluntary economic power, which they found highly beneficial.
Besides the links above, here are some further references:
E. Burke, "The Nabob of Arcot's Debts" -- a screed against the exploitation of "the Carnitic" (part of modern India) by the British East India Company
Charter of the Massachusetts Bay Company (1628)
G.R. Elton, England Under the Tudors, Third Edition (1991)
H.C. Hockett, The Constitutional History of the United States, 1776-1826 (despite the title has some good descriptions of pre-Revolution developments including corporate colonies and judicial of local legislation against the corporate charters)
A. Smith, The Wealth of Nations (esp. Book 4, Ch. 7 "Of Colonies")
N. Szabo, Charters and Judicial Review
N. Szabo, Origins of the Joint-Stock Company
N. Szabo, Jurisdiction as Property