Have you read the docs here:
http://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms#filemanager
Basically what you need to do is as follows (this assumes the filemanager element is called 'attachment', any other name can be used):
- generate a unique ID for the element ($draftid = file_get_submitted_draft_itemid('attachment');)
- copy the existing files into the draft area (file_prepare_draft_area($draftid, $context->id, 'mymod', 'myarea', $myitemid, $options);)
- add the unique ID to the data initialising the form ($data->attachment = $draftid; $form->set_data($data); )
- Once the form is submitted ($submitteddata = $form->get_data() ) ...
- ... copy the files out of the draft area into the final destination (file_save_draft_area_files($data->attachment, $context->id, 'mymod', 'myarea', $myitemid, $options); )
For both file_prepare_draft_area and file_save_draft_area_files, the first parameter identifies the draft area you are copying into / out of (along with your userid, which it gets form the $USER variable). The rest of the parameters identify the area you are wanting to permanently store the files. As long as the $draftitemid is kept somewhere between setting up and submitting the form, it will work (storing it as part of the form data is just a very convenient place to do this).
As for the extra 'files' - that is the root directory/folder for that file area - if you stored 5 files in the area, you would only see one 'directory' entry for them, if you add sub-directories, you will get more of them.
As an extra note - depending on how you are organising your files, you may not have a final itemid to use immediately after the form has been submitted (if you are creating a new entry), so you may have to insert the record first, get the ID and then save the draft files.