Local transportation in Frederick, MD is mostly done through city buses and a few taxi services you should be able to look up with ease.
As Liz stated below the most economical way to get to NYC from Frederick, MD is to take a bus.
I have been making frequent trips there from Frederick, MD for about three years now so I know that the most efficient way is to drive to the White Marsh Park and Ride north of Baltimore and take the Megabus from there. This is assuming you have a car if not I would pay a family member or friend some gas money to take you. Especially if you are traveling for business as I do, always take an early bus because if you take anything later than 7 or 8am you will hit rush hour and your trip could be nearly twice as long.
Taking a plane, train or driving yourself is going to be at least twice as much (I've done all but take a plane). Bus tickets are usually 15-25 dollars one way and as much as 30-60 during the holidays. Make sure you print out a parking pass on their website. As long as you park in the designated part of the lot you should not get towed.
Coming back from NYC, located between 33rd and 34th st and 11th and 12th avenue the Megabus has buses that leave every few hours as late as 11-12 pm usually. I suggest getting there well before then or check the schedule online.
In case you did not drive your own car make sure you schedule someone to pick you up once you're back!
Hope this helps and feel free to call/text anytime if you have any questions.