The most usual passage cited is:
1 Samuel 1:11 (HCSB)
11 Making a vow, she pleaded, “LORD of Hosts, if You will take notice of Your servant’s affliction, remember and not forget me, and give Your servant a son, I will give him to the LORD all the days of his life, and his hair will never be cut.”
1 Samuel 1:23-28 (HCSB)
23 Her husband Elkanah replied, “Do what you think is best, and stay here until you’ve weaned him. May the LORD confirm your word.” So Hannah stayed there and nursed her son until she weaned him. 24 When she had weaned him, she took him with her to Shiloh, as well as a three-year-old bull, half a bushel of flour, and a jar of wine. Though the boy was still young, she took him to the LORD’s house at Shiloh. 25 Then they slaughtered the bull and brought the boy to Eli.
26 “Please, my lord,” she said, “as sure as you live, my lord, I am the woman who stood here beside you praying to the LORD. 27 I prayed for this boy, and since the LORD gave me what I asked Him for, 28 I now give the boy to the LORD. For as long as he lives, he is given to the LORD.” Then he bowed in worship to the LORD there.
Personally, I don't know of anyone who dedicates their child to the LORD as completely as Hannah did. Another commonly referenced passage is Luke 2 when Jesus is brought to the temple. Again, the form of the dedication is not followed since it was following the Jewish circumcision ritual and the command about the firstborn:
Exodus 13:2 (HCSB)
2 “Consecrate every firstborn male to Me, the firstborn from every womb among the Israelites, both man and domestic animal; it is Mine.”
Another example that seems more applicable is:
Mark 10:13-16 (HCSB)
13 Some people were bringing little children to Him so He might touch them, but His disciples rebuked them. 14 When Jesus saw it, He was indignant and said to them, “Let the little children come to Me. Don’t stop them, for the kingdom of God belongs to such as these. 15 I assure you: Whoever does not welcome the kingdom of God like a little child will never enter it.” 16 After taking them in His arms, He laid His hands on them and blessed them.
By implication, even infants are part of the kingdom of God if their parents bring them before Jesus.
Historically, the purpose of the dedication is to replace some of the rituals and ceremonies of baptism when Protestants began to reject the notion of baptizing infants. In the Evangelical Covenant Church, newborns are either baptized or dedicated depending on the preference and conviction of the parents. (PDF source) The only substantive difference is that water and the names of the Trinity are required for baptism. Everything else proceeds on the same lines either way. (I remember one pastor getting to the bit in the liturgy when the baptism might occur and asking the parent, "So we aren't baptizing [name of child here] today, are we? Just making sure. I think we can find some water.")
Dedication turns out to be more about the relationship between the child, the parents, and the church than between the child and God. The parents dedicate themselves to raising a Godly child and the church congregation dedicates itself to assisting the parents in that endeavor.
There is no specific command to dedicate children in the Bible. However, Jesus does say that children are part of His kingdom and so many churches have instituted public ceremonies to introduce newborn into the body of believers.