Pipes are basically simple: input comes in on one end, and is read from the other end. In order to perform basic inter-process communication (IPC), one, original process (the "parent") creates a pipe and then fork()s to make a duplicate of the process (the "child"). At this point the parent and child process each follow separate code paths to do their work. The writing process, usually the child, would write its result to the pipe when done.
If the parent also needs to talk to the child (likely in this case), two pipes must be created and each process will have to wait at some points to receive the other's messages.
Writing code with fork() and pipe() is fairly non-obvious: the linux manpage (http://linux.die.net/man/2/pipe), however, has a nice, simple example of how to make a pipe at the bottom. As far as actual communication is concerned, writing to pipes is typically done with write(), and reading with read() (although other calls, like select() may be useful depending on your needs; as always, read the manpage for more info).
If you don't get what's happening at all, a more in-depth tutorial might be helpful: http://beej.us/guide/bgipc/output/html/multipage/index.html (look at fork and pipe)
A hint for the program: it may help to have one "special" master process which controls all of the synchronization issues.