STM32 GPIO Configuration
If you are using the ST Standard Peripheral library (downloadable from the STM32F4 page, there is also the USB library, plus more stuff), then have a read of the documentation (it's a.chm file at the top level of the zip) and check the example code. All the functions to setup IOs, peripherals, etc are in there.

Here are a couple of snippets showing initialising and using an IO pin from some of my code.

Setting up pins:

#include "stm32f4xx.h"

void LED_Init(void)
{
    GPIO_InitTypeDef GPIO_InitStructure;

    /* Enable the GPIO_LED Clock */
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);

    GPIO_InitStructure.GPIO_Pin = LED1 | LED2 | LED3 | LED4;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
    GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
    GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init(GPIOD, &amp;GPIO_InitStructure);
}


Toggling LED:

    GPIO_SetBits(GPIOD, LED1);
    GPIO_ResetBits(GPIOD, LED2);