TL;DR Gandalf was the Fellowship's guide, with the help of Aragorn. He "lead", not as an appointed leader, but by the strength of his wisdom and knowledge, plus the honor accorded him by the companions.
**** spoilers ahead ****
The companions were chosen by Elrond, and each was only expected to go that part of the distance that corresponded to their own agenda/quest/path home.
'And I will choose you companions to go with you as far as they will or
fortune allows.'
[…]
'With you and your faithful servant, Gandalf will go; for this shall be his great task, and maybe the end of his labours.'
[…]
'Legolas ... and Gimli ... are willing to go at least to the passes of
the Mountains, and maybe beyond.'
[…]
'For men you shall have Aragorn son of Arathorn, for the Ring of
Isildur concerns him closely.'
'Strider!' cried Frodo.
'Yes,' he said with a smile. 'I ask leave once again to be your
companion, Frodo.'
'I would have begged you to come,' said Frodo, 'only I thought you
were going to Minas Tirith with Boromir.'
'I am,' said Aragorn. 'And the Sword-that-was-Broken shall be
re-forged ere I set out to war. But your road and our road lie
together for many hundreds of miles. Therefore Boromir will also be in
the Company.
Fellowship of the Ring: Book II - Chapter 3 - The Ring Goes South
(for completeness sake, Merry and Pippin went also, but their plan was to follow their cousin no matter what, but they had no desire or competency to lead)
And Elrond makes it explicit that no charge or responsibility is laid on any Companion either to follow or to lead (The emphasis is mine):
At that moment Elrond came out with Gandalf, and he called the
Company to him. 'This is my last word,' he said in a low voice. 'The
Ring-bearer is setting out on the Quest of Mount Doom. On him alone is
any charge laid; neither to cast away the Ring, nor to deliver it
to any servant of the Enemy nor indeed to let any handle it, save
members of the Company and the Council, and only then in gravest need.
The others go with him as free companions, to help him on his way. You
may tarry, or come back, or turn aside into other paths, as chance
allows. The further you go, the less easy will it be to withdraw; yet
no oath or bond is laid on you to go further than you will. For you do
not yet know the strength of your hearts, and you cannot forsee what
each may meet upon the road.'
Fellowship of the Ring: Book II - Chapter 3 - The Ring Goes South
So no one is placed under the command of anyone else, but in the time between choosing the companions and their setting out (Again, the emphasis is my own)
Aragorn and Gandalf walked together or sat speaking of their road and
the perils they would meet; and they pondered the storied and figured
maps and books of lore that were in the house of Elrond. Sometimes
Frodo was with them; but he was content to lean on their guidance, and
he spent as much time as he could with Bilbo.
Fellowship of the Ring: Book II - Chapter 3 - The Ring Goes South
If the Ring-bearer was content to rely on the guidance of Gandalf, and the companions were there to help where they could, it only made sense for them to follow the guidance of Gandalf as well. Also, we see here how closely Aragorn and Gandalf worked together.
Gandalf walked in front, and with him went Aragorn, who knew this land
even in the dark.
Fellowship of the Ring: Book II - Chapter 3 - The Ring Goes South
Gandalf and Aragorn debated quite a bit about their path across the Misty Mountains.
Frodo ... understood that Gandalf and Aragorn were continuing some
debate that had begun long before.
[…]
'We must decide before we go further.' answered Gandalf.
'Then let us weigh the matter in our minds, while the others rest and
sleep,' said Aragorn.
In the late afternoon, while the others were finishing their
breakfast, Gandalf and Aragorn went aside together and stood looking
at Caradhras. … Frodo watched them, wondering which way the
debate would go. When they returned to the Company Gandalf spoke, and
then he knew that it had been decided...
Fellowship of the Ring: Book II - Chapter 3 - The Ring Goes South
It seems that Aragorn won this debate, since they followed his path.
'There is a way that we may attempt,' said Gandalf. 'I thought from
the beginning, when first I considered this journey, that we should
try it. But it is not a pleasant way, and I have not spoken of it to
the Company before. Aragorn was against it, until the pass over the
mountains had at least been tried.'
[…]
...said Aragorn heavily. 'You followed my lead almost to disaster in
the snow, and have said no word of blame. I will follow your lead
now...
Fellowship of the Ring: Book II - Chapter 4 - A Journey in the Dark
The general debate about whether they should take the path through Moria shows that the Fellowship (and Gandalf himself) saw Gandalf as guide and not as the boss.
'...the question is: who will follow me, if I lead you there.'
Fellowship of the Ring: Book II - Chapter 4 - A Journey in the Dark
Even Galadriel didn't refer to him as the leader of their company when she first spoke of his absence, noting only that he was with them.
'Gandalf the Grey set out with the Company, but he did not pass the
borders of this land.'
Fellowship of the Ring: Book II - Chapter 7 - The Mirror of Galadriel
Though Frodo does refer to Gandalf as their guide or leader to Galadriel:
'Gandalf was our guide, and he led us through Moria...'
Fellowship of the Ring: Book II - Chapter 7 - The Mirror of Galadriel
and later told Faramir how Aragorn became their guide/leader after they lost Gandalf:
'...Aragorn was forced to lead us. He alone knew the way after
Gandalf's fall.'
Two Towers: Book IV - Chapter 5 - The Window on the West
Aragorn was clearly following Gandalf's guidance, but his words to Frodo at Parth Galen imply that ultimately, it was Gandalf's advice they were following and not his orders. (I have added emphasis)
'In this matter I cannot advise you. I am not Gandalf, and though I
have tried to bear his part, I do not know what design or hope he had
for this hour, if indeed he had any. Most likely it seems that if he
were here now the choice would still wait on you. Such is your fate.'
Fellowship of the Ring: Book II - Chapter 10 - The Breaking of the Fellowship
We know that none of the Fellowship was compelled to follow anybody, but we can see that the Fellowship saw Gandalf as their guide, as the wisest member of their company. It just didn't make sense to bring the wisest person in all Middle Earth with you, and not use him.
The companions did disagree with him at times, however. Aragorn even prevailed upon him to turn from the path he wanted to follow. Certainly Aragorn was very important in his leadership role in the company, both before and especially after Gandalf's fall.