79thPA has given you the basics of command personnel for a typical Continental infantry company; it varied slightly from State to State, and certainly varied in terms of officers during the course of the war. Three or four officers and a similar number of sergeants was typical for a company in all armies during the war, and for all troop types (Regulars, Militia and anything in between).
The response about the different organisations is half-right and half-wrong. The tactical unit was the platoon, which for the purposes of this war was mostly synonymous with the administrative unit known as the company within the American, British and French armies because of the typical battalion/regimental strengths and organisation (8 or, if you include flank troops, 10 companies). Only the German units – who followed the Prussian model almost to the letter – had substantially different set-ups for administration and marching/fighting.
As regards Cadian's point, in 1771, Townshend (Wolfe's 2IC in Canada and then commander of the troops in Ireland) published a memo on the handling of skirmishers following the (re-)introduction of a "light" company into the Line regiments of the British Army. This included the use of the file, of two men, a the basic unit; the men were to be encouraged to choose their partner to cement comradeship and "esprit", and the practice of one always being loaded was recommended by Townshend.
Finally, unit size for your purposes. For firing and manoeuvre, a platoon was generally about 30-40 men for the British and Americans, slightly larger (up to double that amount) for the Germans and French. This is the "vanilla" version, of which there would be "X" per battalion – usually eight, as this provided symmetry in terms of lining up and higher sub-units of the battalion/regiment. First, there were pairs of platoons, known as "divisions" (also called "grand divisions" – some Continental units had a colour for each of the four grand divisions, either red, blue, white, or buff), and "wings" (four platoons/two divisions – usually half the battalion/regiment – as the war progressed this became a very widely-used tactical unit for the British, with one wing in open order or "loose files" and the other wings in close order to provide support or a rallying point).
For the kind of independent action you are looking at, there were three ways that a detachment of, say, 40 men could be created:-
1) It could be taken straight from the normal establishment of the battalion/regiment – eg "Captain Smith's company".
2) It could consist of "picked men" carefully chosen from across the entire battalion/regiment – often selected from those who were the best marksman or good at fieldcraft. This type of detachment would arguably (depending on the overall status of the battalion/regiment) have an "elite" quality to it.
3) The most common method of forming a detachment – eg for guard duty or a working party – in European armies was to take "x" men or files from several companies. There were several reasons for this, which included (a) helping the men of a battalion to get to know others from outside their own company/mess; (b) it limited mass desertion in situations where the men would be dispersed and less closely supervised; and (c) if the detachment was killed or captured, it would spread the loss (bear in mind company commanders still had a financial interest in their company in this period).
Sorry if that went on a bit – hope it helps.