This article is from the Mac Programming FAQ, by Jon Watte h+@austin.metrowerks.com with numerous contributions by others.
Here is what you need to do:
Define a storage location for the plug-ins. such as, for an application
called Foo, a folder called "Foo Pouch/ PlugIns/ Modules/ Tools/ Etc",
which your installer creates, and which you search for in the same
folder as your application, the preferences folder, and the System
Folder (for System 6 (no preferences)) the name of the pouch folder
should be in a 'STR ' or 'STR#' resource for easy internationalization.
Next, define a resource type to hold your plug-in exectuable code. You
should allow any resID number, since some development systems have
restrictions on which id numbers can be used for multi-segment code
resources.
Decide whether you will allow multiple code resources per file. For
example, Photoshop lets you bundle an import resource, an export
resource, and a filter into the same file, each is its own resource
type. It uses the resource name to tell the user, so each has its own
name.
Decide on the user interface to plug-ins. Commonly, at program
start-up, you scan the pouch and collect all the files of the correct
types. Then you scan for appropriate code resources, then put the names
of the resources in the menus. You can also use the file names, or run
the code resources and ask them for the correct name.
Decide on the calling convention. MPW likes to pass parameters as
longs, and pascal development systems usually can't generate C
interfaces, so your best bet is to have the entry point of your code
resource be something like:
extern pascal long PlugIn(long selector, CallbackPtr callback,
long param1, long param2, long param3, long refcon);
where params 1 through 3 will have specific meanings depending upon
which function selector is asking to be performed.
CallbackPtr is something like this:
typedef struct CallbackRec{
DrawFunc erase;
DrawFunc paint;
}CallbackRec, *CallbackPtr;
*code*
h = GetResource('PLUG', 1);
HLock(h);
xh = StripAddress(h);
((PlugInFunc) *xh)(kInit, callbacks, kInterfaceVer1, kProgVer1, 0, 0);
HUnlock(h);
*end*
 
Continue to: