As far as I know the existing converters are working but have their limitations (which are based on the fact that these two formats are so different that you can't handle all conversion cases and some only with user interaction or predefined settings).
Some hints if you still want to do it yourself:
- Get the DXF and G-code format specifications
- Understand the structures of the formats
- Define rules to handle global and block scope data
- Define conversion rules for the elements (here: DXF element to G-code instructions)
- If necessary handle version specific cases
- Implement the rules in code
To get an idea of what you have to do I suggest to have a look at some open source converters. If you have specific requirements, it might be even simpler to implement missing features into one of those.