You write it using notepad.
If you mean how do I save it as a .cpp file just set that in the name.
If you mean how do I write one then the best thing to do is to take someone elses addon, open up their config.cpp and alter it to suit. There is a config.cpp tutorial on this site.
Also BIS' edited configs are availble to download somewhere but they might confuse you.
What are you trying to config?