Peter,
A lot depends on what your controller expects. I downloaded the demo of easycnc2 and to be honest I wasn't very impressed. There are three types of people putting these packages together, Techies, Graphics Artists and machinists.........it wasn't the latter.



17 million fonts in windows and some twonk has to get all artistic ? A machinist wants something that can be read 4 shops away.
First screen has an instruction at the bottom that says click on file and select new, we have Edit, Machine, Emulate, Settings and Help.

No file, file should be next to Edit, [ standard windows layout ] aahh wait click green icon of a milling machine and you get file.

Silly me why didn't I think that one green icon and 5 standard windows tabs are normal ?

Anyway to get back to your question how to get G Code.

There are three stages in getting code, one you draw your part in CAD, plenty of free or cheap cad programs out there, been covered many times, go a google.

Second is getting a drawing file to code and this entails using a CAM package. Again plenty out here from simple to mega complex and expensive.
Unfortunately not many free ones and not many good cheap ones.
Kip mentioned using Lazycam that is built into Mach, it's one of those programs that either [a] you can use it straight off or [b] you never get the hang of it, the free one is limited, pro version is a paid upgrade.
Sheetcam is good, Vectric 2D is good, both have a similar price tag and from there on it's chequebook out time.

However [ big drum roll ] there is a simple free way with no strings attached.
Go to http://www.flashcutcnc.com and look at there controller.
It's a stand alone controller that used the usb port and outputs to a set of drivers.
It also has a $1,000 price tag.

However the software on the site isn't crippled as you need the USB box to make it run.
Download the demo version, not live version and under File [ which is in the correct place ] select import DXF and find your DXF, note here the drawing will have to be drawn offset as the program can't work out offsets.

Load the dxf and the first thing it wants to do is save it as drawingxxx.fgc in C:\FlashcutData|DXF, let it do this.
then you get a menu box up where you put depths, cutc per pass, feeds etc and press OK and it writes the code and you can see it run on screen but you can't cut it as you don't have the USB Box.

BUT the code is now residing in C:\Flashcutdata|DXF\drawingxxx.fgc
Open this in notepad and you now have a valid G Code to use in your controller of choice.

.