I would still suggest you see the MSDN and read more about threads because it can be quite troublesome when dealing with threads.

If you think you still need a sample refe Worker Threads in MFC and codes there but I am sure writing codes for threads needs a good knowledge before even attempting it.