First, you need to define a command set. For instance, you might want commands to set the direction, to set the speed, and to actually step the motor. You might have:
R xxx (rpm)
S xxx (step)
You need delimiters for the commands, so the Arduino knows when a command starts and ends. For instance, the Processing sketch might send >B< to tell the Arduino that the next motion command is to make the motor go backwards, followed by >R150< to set the speed, and then >S900< to step 900 times.
On the Arduino side, you’d use Serial.begin(), Serial.available(), and Serial.read to read the serial data. Collect the data when you see a > and stop collecting when you see a <.
The amount of data to read will be defined by the first letter. You only need to store one character and one integer, using a scheme like this.
The use of the serial port in a Processing sketch is pretty simple, once you know which port to talk to. The examples in Processing will show you how to figure that out.
Then, use begin and print to enable and perform serial communication.
If you run into trouble, come on back.