I just ran a quick search at www.ravelry.com
and the first pattern that popped up was Legwarmies
. It will give you pretty good idea of what you want to do. It calls for dpn I saw but could easily be done on circular needles. If you want to knit it flat and seam, add an extra stitch on each edge. There is probably a pattern to knit flat then seam too.
ETA: If you knit the child's size first you could then size the pattern down as needed for the baby. HTH