I can't speak for everywhere in the country, but around here before you get to the part of installing the new electrical service you need to contact the electric company and tell them you want to install a new service. They will send you some paperwork and you need to fill it out and you need to include a rough drawing of where the building is in relation to the power lines, etc. You also need to have distances on the drawing and you need to tell them an approximate date as to when you will want the power lines run. (It is best to contact the electric company before you even build the garage to be sure there will be no complications later on, but that is NOT something you HAVE to do) Once the electric company receives the paperwork and they check it over, someone from the power company will stop by take a look at what needs to be done and how they plan to do it. At that time they will decide the best way to run the power lines. In my case they not only ran new power lines to the garage, they also moved the power lines going to my house to a different location on the main lines coming from the street.
Now, having said all that, I will try to answer your question.
Install a service panel. What does that mean exactly? Install a loadcenter? Or go pull a permit?
Putting in a new electrical service around here involves the following: The master electrician comes to your house, or garage, or workshop, or whatever, and looks it over. Then he goes to city hall (in my case about six blocks from my house) and gets the permit. Initially he pays for the permit but ultimately you will get charged for it.
Then the electrician will install the meter base, run the mast up the building, anchor it into the side of the building, and attach a mast head. He will mount the breaker panel to the inside of the building and a he will drill a hole from the back of the meter base, thru the building wall, and into the breaker panel, after which he will install a coupler between the meter base and the breaker panel. He will run three cables from the mast head down to the meter base, then from the meter base into the breaker panel. He will dig a trench for the two 8 foot copper coated grounding rods (they need to be 6 feet apart) and he will pound the rods into the ground. Then he will attach a grounding wire to the grounding rods and run it into the breaker panel. Once that is done, he will run three cables from the meter base thru the coupler and into the breaker panel. Then he will install a light with a light switch above the breaker panel and he will install an electrical outlet underneath the breaker panel. That's what you will get for between $1,800 and $2,200, possibly a bit more or less depending on where you are located and what size service you want installed.
Now, having said that, I happen to have had the benefit of knowing a master electrician and a good friend who was willing to help me do this. After talking with the master electrician and having him stop by and give us some guidance, I went out and bought the meter base, breaker panel, mast, mast head, grounding rods, grounding wire, the mast head and the cable running from the mast head down to the meter base and enough extra cable to run it into the breaker panel.
My friend and I did most of the work ourselves, we mounted the meter base and the breaker panel, then we ran the mast up the side of the building and attached it with the proper fasteners. After that we ran the cable down the mast and into the meter base, leaving plenty of cable to stick out of the mast head so the electric company would have no problem in connecting the main power lines to the mast head. Then we dug the trench for the grounding rods. After that, I got hold of the master electrician and told him we were ready for him to come by and hook it up. The first thing the master electrician did was to go over to city hall and pick up the permit. Then he came by and he checked ALL of our work to be certain it was done right. Once he was satisfied we had done EVERYTHING according to code, he connected the power cables from the mast head to the meter base, then he ran the cables into the breaker panel. Once that was done, he had an electric pounder that hammered the grounding rods 8 feet into the ground, which was wonderful because having to do that by hand would have been a real pain. Then he connected the grounding cable to both of the grounding rods and ran it into the garage thru the hole in the wall we had made ahead of time for this purpose.
Finally, he wired up the light switch and the light, and he wired in the outlet underneath the breaker panel.
Once he was done he went back to city hall and informed the city inspector the job was finished. The city inspector came by the following day and checked it all out. He passed it and then he contacted the electric company to come and install the main lines.