Governing Law
The governing law in this fact pattern would be the law of Delaware which under the relevant choice of law rules governs the internal affairs of a Delaware Corporation, specifically, the Delaware General Corporate Law (Title 8 of the Delaware Code starting with Chapter 1), as interpreted by the Delaware Courts, especially the Delaware Court of Chancery and the Delaware Supreme Court.
The incorporators of the Corporation who file the Certificate of Incorporation for the Corporation with the Delaware Secretary of State control the Corporation until its directors are appointed by the incorporators, and once the directors are appointed (unless the directors are named in the Certificate of Incorporation itself or a different method for their appointment is set forth in the Certificate of Incorporation), and the shares of stock in the Corporation come into being when they issue shares. See, primarily 8 Delaware Code §§ 101, 107, 151, 152 and 158.
But, the incorporators and directors may be subject to oral or written agreements, or to fiduciary duties (e.g. if the incorporator is also an attorney for the founders), that significantly limits their discretion in this regard.
Also, certain rights arising from a subscription agreement (which is an agreement to purchase shares not yet issued of a corporation), must be in a signed writing to be enforced (subject to certain common law exceptions). 8 Delaware Code § 166.
Application To Hypothetical Facts
Using 3 out of 5 board seats, investor B then fired the founder and
CEO, whose shares, it's revealed, have a vesting schedule.
My question is: who owns the company at this point (assuming a
negligible fraction of the shares vested)? Wouldn't investor A's 10%
stake trump investor B's 5% and give him the right to elect all board
members?
Corporations formed under Delaware law have very broad discretion to tailor their terms to the wishes of the parties, and most of the statutory provisions are merely default rules of law that apply when not displaced by the governing documents of the corporation.
If the governing documents provide that particular investors get board seats, then, notwithstanding the share ownership of the investors and shareholders, those investors get board seats. With respect to directors, this authority is formally expressly primarily at 8 Delaware Code § 141(a).
Control of a corporation doesn't have to align with beneficial economic ownership of a corporation under Delaware law (or for that matter, in for profit corporations in most U.S. jurisdictions).
It isn't uncommon in a Delaware corporation for control of a corporation to be vested in shareholders (and even some non-shareholders) who control only a minority of the economic value of a corporation's shares.
There are several different ways that this can be documented from a nuts and bolts legal perspective, but the bottom line is that he who controls the board controls the corporation, and that selection of the board of directors can be varied by agreement as expressed in the governing documents (always a certificate of incorporation, usually bylaws, and sometimes also some sort of shareholder's agreement or voting trust).